[wp-trac] [WordPress Trac] #42960: get_page_permastruct call causes 500 error.

WordPress Trac noreply at wordpress.org
Sun Dec 13 21:56:33 UTC 2020


#42960: get_page_permastruct call causes 500 error.
-------------------------------------+----------------------
 Reporter:  wcwilson1950             |       Owner:  (none)
     Type:  enhancement              |      Status:  closed
 Priority:  normal                   |   Milestone:
Component:  Rewrite Rules            |     Version:
 Severity:  normal                   |  Resolution:  invalid
 Keywords:  reporter-feedback close  |     Focuses:
-------------------------------------+----------------------
Description changed by SergeyBiryukov:

Old description:

> This was discussed in #7589. I can't seem to find the plugin that is
> causing this problem. Obviously somebody is making the call to
> get_page_permastruct before $wp_rewrite is being initialized; in my case
> it's on logout and trying to redirect to the logout page.
>
> It would be a help to wrap the call to
> $wp_rewrite->get_page_permastruct() on line 356, with an if statement
> that tests for null $wp_rewrite. The rest of the code functions if that
> approach is taken.
>
> if (!empty($wp_rewrite)) {
>            $link = $wp_rewrite->get_page_permastruct();
> }

New description:

 This was discussed in #7589. I can't seem to find the plugin that is
 causing this problem. Obviously somebody is making the call to
 get_page_permastruct before $wp_rewrite is being initialized; in my case
 it's on logout and trying to redirect to the logout page.

 It would be a help to wrap the call to $wp_rewrite->get_page_permastruct()
 on line 356, with an if statement that tests for null $wp_rewrite. The
 rest of the code functions if that approach is taken.
 {{{
 if (!empty($wp_rewrite)) {
            $link = $wp_rewrite->get_page_permastruct();
 }
 }}}

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42960#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list