Make WordPress Core


Ignore:
Timestamp:
04/11/2022 05:09:53 AM (3 years ago)
Author:
peterwilsoncc
Message:

Posts, Post Types/Taxonomies: Add object type specific registration filters.

Add post type and taxonomy specific registration argument hooks.

Introduces the filters register_{$post_type}_post_type_args and register_{$taxonomy}_taxonomy_args. Introduces the actions registered_post_type_{$post_type} and registered_taxonomy_{$taxonomy}.

Props pbiron, dlh, davidbaumwald, hellofromTonya, milana_cap.
Fixes #53212.

File:
1 edited

Legend:

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

    r53058 r53126  
    315315         */
    316316        $args = apply_filters( 'register_taxonomy_args', $args, $this->name, (array) $object_type );
     317
     318        $taxonomy = $this->name;
     319
     320        /**
     321         * Filters the arguments for registering a specific taxonomy.
     322         *
     323         * The dynamic portion of the filter name, `$this->name`, refers to the taxonomy key.
     324         *
     325         * @since 6.0.0
     326         *
     327         * @param array    $args        Array of arguments for registering a taxonomy.
     328         *                              See the register_taxonomy() function for accepted arguments.
     329         * @param string   $taxonomy    Taxonomy key.
     330         * @param string[] $object_type Array of names of object types for the taxonomy.
     331         */
     332        $args = apply_filters( "register_{$taxonomy}_taxonomy_args", $args, $this->name, (array) $object_type );
    317333
    318334        $defaults = array(
Note: See TracChangeset for help on using the changeset viewer.