Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Subscribe success page redirect uses post guid #80

Open
leanwebstart opened this issue Sep 14, 2018 · 0 comments
Open

Subscribe success page redirect uses post guid #80

leanwebstart opened this issue Sep 14, 2018 · 0 comments

Comments

@leanwebstart
Copy link

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant