Taxonomy: Introduce new hooks when registering/unregistering taxonomies for object types.
Props soulseekah. Fixes #44733. Built from https://develop.svn.wordpress.org/trunk@43558 git-svn-id: http://core.svn.wordpress.org/trunk@43387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
071984839c
commit
297c7e4c8f
|
@ -613,6 +613,16 @@ function register_taxonomy_for_object_type( $taxonomy, $object_type ) {
|
|||
// Filter out empties.
|
||||
$wp_taxonomies[ $taxonomy ]->object_type = array_filter( $wp_taxonomies[ $taxonomy ]->object_type );
|
||||
|
||||
/**
|
||||
* Fires after a taxonomy is registered for an object type.
|
||||
*
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param string $taxonomy Taxonomy name.
|
||||
* @param string $object_type Name of the object type.
|
||||
*/
|
||||
do_action( 'registered_taxonomy_for_object_type', $taxonomy, $object_type );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -644,6 +654,17 @@ function unregister_taxonomy_for_object_type( $taxonomy, $object_type ) {
|
|||
}
|
||||
|
||||
unset( $wp_taxonomies[ $taxonomy ]->object_type[ $key ] );
|
||||
|
||||
/**
|
||||
* Fires after a taxonomy is unregistered for an object type.
|
||||
*
|
||||
* @since 5.0.0
|
||||
*
|
||||
* @param string $taxonomy Taxonomy name.
|
||||
* @param string $object_type Name of the object type.
|
||||
*/
|
||||
do_action( 'unregistered_taxonomy_for_object_type', $taxonomy, $object_type );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.0-alpha-43556';
|
||||
$wp_version = '5.0-alpha-43558';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue