Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#12918 closed defect (bug) (fixed)

Register default post types before plugins and themes are loaded

Reported by: ryan's profile ryan Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords:
Focuses: Cc:


Although correct behavior is to wait until init has fired to do anything, many themes call get_pages() prior to init. If the default post types have not been registered yet, get_pages() will fail because the "page" post type is not present. We can work around this in the same manner as we did for taxonomies by calling create_initial_post_types() before loading plugins and themes.

Attachments (1)

12918.diff (667 bytes) - added by ryan 14 years ago.

Download all attachments as: .zip

Change History (4)

14 years ago

#1 @nacin
14 years ago

Works for me. Closing #12873 as a duplicate.

#2 @ryan
14 years ago

Wow, my search for existing tickets on the issue was obviously a failure. :-)

#3 @ryan
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14041]) Call create_initial_post_types() before plugins and themes are loaded so that premature post API calls don't fail. fixes #12918

Note: See TracTickets for help on using tickets.