WordPress.org

Make WordPress Core

Changeset 43558


Ignore:
Timestamp:
08/08/2018 07:14:08 PM (16 months ago)
Author:
boonebgorges
Message:

Taxonomy: Introduce new hooks when registering/unregistering taxonomies for object types.

Props soulseekah.
Fixes #44733.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/taxonomy.php

    r43520 r43558  
    614614    $wp_taxonomies[ $taxonomy ]->object_type = array_filter( $wp_taxonomies[ $taxonomy ]->object_type );
    615615
     616    /**
     617     * Fires after a taxonomy is registered for an object type.
     618     *
     619     * @since 5.0.0
     620     *
     621     * @param string $taxonomy    Taxonomy name.
     622     * @param string $object_type Name of the object type.
     623     */
     624    do_action( 'registered_taxonomy_for_object_type', $taxonomy, $object_type );
     625
    616626    return true;
    617627}
     
    645655
    646656    unset( $wp_taxonomies[ $taxonomy ]->object_type[ $key ] );
     657
     658    /**
     659     * Fires after a taxonomy is unregistered for an object type.
     660     *
     661     * @since 5.0.0
     662     *
     663     * @param string $taxonomy    Taxonomy name.
     664     * @param string $object_type Name of the object type.
     665     */
     666    do_action( 'unregistered_taxonomy_for_object_type', $taxonomy, $object_type );
     667
    647668    return true;
    648669}
Note: See TracChangeset for help on using the changeset viewer.