Make WordPress Core

Opened 16 years ago

Closed 16 years ago

#12918 closed defect (bug) (fixed)

Register default post types before plugins and themes are loaded

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

Description

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 16 years ago.

Download all attachments as: .zip

Change History (4)

@ryan
16 years ago

#1 @nacin
16 years ago

Works for me. Closing #12873 as a duplicate.

#2 @ryan
16 years ago

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

#3 @ryan
16 years ago

  • Resolutionfixed
  • Status newclosed

(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.