Make WordPress Core

Opened 10 months ago

Last modified 6 months ago

#58536 new defect (bug)

url_to_postid does not work at MS install in context of another blog when $wp_rewrite->use_verbose_page_rules differs

Reported by: davidbinda's profile david.binda Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Rewrite Rules Keywords:
Focuses: multisite Cc:


In a multisite installation, where there are blogs with mixed permastruct of some have the $wp_rewrite->use_verbose_page_rules set to true and some to false, the url_to_postid fails to find a post, since it's queried as a page, due to a falsey check.

As the rewrites rules are untouched upon switch_to_blog action and as the url_to_postid function works directly with the rewrite_rules option (via `WP_Rewrite::wp_rewrite_rules()` function ), IMHO the best way to fix such a case would be to not rely on the property, but perform the same check as when the use_verbose_page_rules property is being set (see the attached patch).

Attachments (1)

58536.diff (2.1 KB) - added by david.binda 10 months ago.

Download all attachments as: .zip

Change History (2)

10 months ago

#1 @sabernhardt
6 months ago

  • Component changed from General to Rewrite Rules
  • Focuses multisite added
Note: See TracTickets for help on using tickets.