[wp-trac] [WordPress Trac] #36188: After WordPress installation, the default category archive page is showing a 404 page

WordPress Trac noreply at wordpress.org
Mon Jul 18 03:44:11 UTC 2016


#36188: After WordPress installation, the default category archive page is showing
a 404 page
-------------------------------------+------------------------------
 Reporter:  strategio                |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Rewrite Rules            |     Version:  4.2
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------------

Comment (by seancjones):

 First off, thanks @boonebgorges for the tips on patches.

 Second, to recap this bug:

 This bug has been in existence ever since WordPress 4.2, when pretty
 permalinks were installed by default. After further digging, the reason
 this bug cropped up is because extra permastructs are not registered until
 the init hook, which is never called during installation. This looks like
 it's by design, to avoid conflicts. The only permastruct which is
 necessary at install is the category. So, we have a few options, including
 running the function on the next page load (seems like overkill), or
 manually registering categories (doesn't scale without effort).

 My preferred option is to run the `init` action after the `wp_install`
 action (please see attached patch). I have tested this on single site and
 multi-site and have not seen any issues. This only happens after the
 install has concluded and, given that no plugins are activated on a new
 site install, should be equivalent to a page refresh on the home page. I
 also moved `flush_rewrite_rules` to run after `init`.

 Hope to get some feedback. Thanks in advance!

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


More information about the wp-trac mailing list