Make WordPress Core


Ignore:
Timestamp:
02/05/2020 06:24:16 AM (5 years ago)
Author:
SergeyBiryukov
Message:

Taxonomy: In register_taxonomy(), return the registered taxonomy object on success, for consistency with register_post_type().

Props krynes, SergeyBiryukov.
Fixes #48558.

File:
1 edited

Legend:

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

    r47122 r47186  
    409409 *                                                Default false.
    410410 * }
    411  * @return void|WP_Error Void on success, WP_Error object on failure.
     411 * @return WP_Taxonomy|WP_Error The registered taxonomy object on success, WP_Error object on failure.
    412412 */
    413413function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
     
    442442     */
    443443    do_action( 'registered_taxonomy', $taxonomy, $object_type, (array) $taxonomy_object );
     444
     445    return $taxonomy_object;
    444446}
    445447
Note: See TracChangeset for help on using the changeset viewer.