Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#18802 closed enhancement (fixed)

New hooks when taxonomies and post_types are registered

Reported by: simonwheatley Owned by: westi
Priority: normal Milestone: 3.3
Component: Posts, Post Types Version: 3.2.1
Severity: normal Keywords: has-patch westi-likes
Cc: Focuses:

Description

These new hooks allow plugin and theme developers to react to post types and taxonomies being registered.

I've created the diffs with Git, and they look different to the SVN generated ones I'm used to, so let me know if they aren't acceptable.

Attachments (2)

new_hook.diff​ (403 bytes ) - added by simonwheatley 15 years ago.
New hook registered_post_type for register_post_type
new_tax_hook.diff​ (458 bytes ) - added by simonwheatley 15 years ago.
New hook registered_taxonomy for register_taxonomy

Download all attachments as: .zip

Change History (6)

@simonwheatley
15 years ago

New hook registered_post_type for register_post_type

@simonwheatley
15 years ago

New hook registered_taxonomy for register_taxonomy

#1 @sirzooro
15 years ago

  • Cc sirzooro added

+1 for this. Now the only way to register something for each post type (e.g. add custom column to post list) is to register hook for init action with high priority value, to make sure all custom post types and taxonomies are already registered.

#2 @westi
15 years ago

  • Keywords westi-likes added
  • Milestone Awaiting Review → 3.3
  • Status new → accepted

These sound like a great idea.

I'm half convinced to call this a bug not an enhancement ;)

#3 @westi
15 years ago

  • Resolution → fixed
  • Status accepted → closed

In [18833]:

Fire an action when a post type or taxonomy is registered so plugins can react. Fixes #18802 props simonwheatley.

#4 @scribu
15 years ago

  • Cc scribu added
Note: See TracTickets for help on using tickets.