Make WordPress Core

Opened 15 years ago

Closed 9 years ago

#12539 closed enhancement (wontfix)

Add hook to create_initial_post_types()

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

Description

I'd like to propose that create_initial_post_types() in wp-includes/post.php have a filter called 'initial_post_types' (or something else) that will allow a hook to remove default post types and/or modify the attributes of post types before they are registered. I've included a patch to illustrate. The same could be done with the post statues but doing so is a bit more complicated so I didn't implement that in case the core devs hate the idea.

As suggested by dd32 from #9674 I created this new ticket.

Attachments (1)

post.php.diff (4.9 KB) - added by mikeschinkel 15 years ago.
Update to /wp-includes/post.php to add a filter called 'initial_post_types'

Download all attachments as: .zip

Change History (13)

@mikeschinkel
15 years ago

Update to /wp-includes/post.php to add a filter called 'initial_post_types'

#1 @mikeschinkel
15 years ago

  • Cc mikeschinkel@… added

#2 @unsalkorkmaz
15 years ago

  • Cc unsalkorkmaz added

#3 @nacin
15 years ago

  • Milestone changed from Unassigned to 3.0

#4 @mikeschinkel
15 years ago

Thank you! :)

#5 @nacin
15 years ago

Not blessing it per se, but 3.0 would be the time to review this.

#6 follow-up: @dd32
15 years ago

  • Milestone changed from 3.0 to 3.1

We're in feature freeze, Approaching Beta in the near future, This is an enhancement and is not a regression over the previous release. Moving to 3.1 for now.

The addition of the custom post_types to 3.0 has been of benefit, but mearly filtering these post_types is not all that needs to be done to prevent certain post types from being invisible to WordPress.

This would be better fixed in 3.1 as the post_type api and internal use matures.

#7 in reply to: ↑ 6 @mikeschinkel
15 years ago

Replying to dd32:

We're in feature freeze, Approaching Beta in the near future, This is an enhancement and is not a regression over the previous release. Moving to 3.1 for now.

The addition of the custom post_types to 3.0 has been of benefit, but mearly filtering these post_types is not all that needs to be done to prevent certain post types from being invisible to WordPress.

This would be better fixed in 3.1 as the post_type api and internal use matures.

Agreed. Better to do this one well vs. quickly.

#8 @kevinB
14 years ago

  • Cc kevinB added

#9 follow-up: @nacin
14 years ago

  • Milestone changed from Awaiting Triage to Future Release

I think we still have a long ways to go decoupling the core taxonomies and core post types...

#10 in reply to: ↑ 9 @mikeschinkel
13 years ago

I was just reviewing my tickets, and this was (partially) addressed in prior version but this ticket was never updated.

HOWEVER, and this does need to be addressed, create_initial_post_types() is called TWICE. See #19692.

#11 @chriscct7
10 years ago

  • Keywords needs-refresh added

#12 @wonderboymusic
9 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

The reasons for [14041] still exist. At this point, the run on init is an insurance policy

Note: See TracTickets for help on using tickets.