wordpress icon indicating copy to clipboard operation
wordpress copied to clipboard

Subscribe success page redirect uses post guid

Open leanwebstart opened this issue 7 years ago • 0 comments

Guid's are not a good source of redirect URL... in time the actual domain/url of the page can change but the GUID by definition will not... this has caused me trouble in a site where we configured in a subdomain (staging.xxx.com) and then deployed... the guid stayed as staging.xxx.com...

In class_sendgrid_tools ...

 /**
   * Return the value for the signup confirmation page url
   *
   * @return  mixed   signup confirmation page url, false if the value is not found
   */
  public static function get_mc_signup_confirmation_page_url()
  {
    $page_id = self::get_mc_signup_confirmation_page();
    if ( false == $page_id or 'default' == $page_id ) {
      return false;
    }

    $confirmation_pages = get_pages( array( 'parent' => 0 ) );
    foreach ( $confirmation_pages as $key => $page ) {
      if ( $page->ID == $page_id ) {
        return $page->guid;
      }
    }

    return false;
  }

return $page->guid should be refactored...

I don't know wordpress much but would'nt get_permalink() be a better choice?

leanwebstart avatar Sep 14 '18 16:09 leanwebstart