WordPress.org

Make WordPress Core

Changeset 43632


Ignore:
Timestamp:
09/06/2018 07:50:29 AM (12 months ago)
Author:
SergeyBiryukov
Message:

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

Props soulseekah.
Merges [43558] and [43631] to the 4.9 branch.
Fixes #44733.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/src/wp-includes/taxonomy.php

    r43510 r43632  
    579579    $wp_taxonomies[ $taxonomy ]->object_type = array_filter( $wp_taxonomies[ $taxonomy ]->object_type );
    580580
     581    /**
     582     * Fires after a taxonomy is registered for an object type.
     583     *
     584     * @since 4.9.9
     585     *
     586     * @param string $taxonomy    Taxonomy name.
     587     * @param string $object_type Name of the object type.
     588     */
     589    do_action( 'registered_taxonomy_for_object_type', $taxonomy, $object_type );
     590
    581591    return true;
    582592}
     
    607617
    608618    unset( $wp_taxonomies[ $taxonomy ]->object_type[ $key ] );
     619
     620    /**
     621     * Fires after a taxonomy is unregistered for an object type.
     622     *
     623     * @since 4.9.9
     624     *
     625     * @param string $taxonomy    Taxonomy name.
     626     * @param string $object_type Name of the object type.
     627     */
     628    do_action( 'unregistered_taxonomy_for_object_type', $taxonomy, $object_type );
     629
    609630    return true;
    610631}
Note: See TracChangeset for help on using the changeset viewer.