From 2421e0ecc6b712b9dbf38773af42bba325701e0a Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Fri, 30 Sep 2011 09:53:35 +0000 Subject: [PATCH] Fire an action when a post type or taxonomy is registered so plugins can react. Fixes #18802 props simonwheatley. git-svn-id: https://develop.svn.wordpress.org/trunk@18833 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 2 ++ wp-includes/taxonomy.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/wp-includes/post.php b/wp-includes/post.php index 76fdd6507c..f18e94084d 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -1037,6 +1037,8 @@ function register_post_type($post_type, $args = array()) { register_taxonomy_for_object_type( $taxonomy, $post_type ); } + do_action( 'registered_post_type', $post_type, $args ); + return $args; } diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index e231a6cdef..19bc1cd798 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -363,6 +363,8 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) { // register callback handling for metabox add_filter('wp_ajax_add-' . $taxonomy, '_wp_ajax_add_hierarchical_term'); + + do_action( 'registered_taxonomy', $taxonomy, $object_type, $args ); } /**