apply_filters( 'register_taxonomy_args', array $args, string $taxonomy, string[] $object_type )

Filters the arguments for registering a taxonomy.


Parameters Parameters

$args

(array) Array of arguments for registering a taxonomy. See the register_taxonomy() function for accepted arguments.

$taxonomy

(string) Taxonomy key.

$object_type

(string[]) Array of names of object types for the taxonomy.


Top ↑

Source Source

File: wp-includes/class-wp-taxonomy.php

View on Trac



Top ↑

Changelog Changelog

Changelog
Version Description
4.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by hwk-fr

    Usage example:

    add_filter( 'register_taxonomy_args', 'wpdocs_my_taxonomy_args', 10, 2 );
    function wpdocs_my_taxonomy_args( $args, $taxonomy ) {
        
        // Target "my-taxonomy"
        if ( 'my-taxonomy' !== $taxonomy ) {
            return $args;
        }
        
        // Set Hierarchical
        $args['hierarchical'] = true;
        
        // Return
        return $args;
    }

You must log in before being able to contribute a note or feedback.