taxonomy_parent_dropdown_args filter-hookWP 3.7.0

Filters the taxonomy parent drop-down on the Edit Term page.

Usage

add_filter( 'taxonomy_parent_dropdown_args', 'wp_kama_taxonomy_parent_dropdown_args_filter', 10, 3 );

/**
 * Function for `taxonomy_parent_dropdown_args` filter-hook.
 * 
 * @param array  $dropdown_args An array of taxonomy parent drop-down arguments.
 * @param string $taxonomy      The taxonomy slug.
 * @param string $context       Filter context. Accepts 'new' or 'edit'.
 *
 * @return array
 */
function wp_kama_taxonomy_parent_dropdown_args_filter( $dropdown_args, $taxonomy, $context ){

	// filter...
	return $dropdown_args;
}
$dropdown_args(array)

An array of taxonomy parent drop-down arguments.

  • hide_empty(int|true|false)
    Whether to hide terms not attached to any posts.

  • hide_if_empty(true|false)
    Whether to hide the drop-down if no terms exist.
    Default: false

  • taxonomy(string)
    The taxonomy slug.

  • name(string)
    Value of the name attribute to use for the drop-down select element.
    Default: 'parent'

  • orderby(string)
    The field to order by.
    Default: 'name'

  • hierarchical(true|false)
    Whether the taxonomy is hierarchical.
    Default: true

  • show_option_none(string)
    Label to display if there are no terms.
    Default: 'None'
$taxonomy(string)
The taxonomy slug.
$context(string)
Filter context. Accepts 'new' or 'edit'.

Changelog

Since 3.7.0 Introduced.
Since 4.2.0 Added $context parameter.

Where the hook is called

In file: /wp-admin/edit-tags.php
taxonomy_parent_dropdown_args
wp-admin/edit-tags.php 504
$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'new' );
wp-admin/edit-tag-form.php 193
$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'edit' );

Where the hook is used in WordPress

Usage not found.