taxonomy_parent_dropdown_args хук-фильтрWP 3.7.0

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

Использование

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(массив)

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.
    По умолчанию: false

  • taxonomy(строка)
    The taxonomy slug.

  • name(строка)
    Value of the name attribute to use for the drop-down select element.
    По умолчанию: 'parent'

  • orderby(строка)
    The field to order by.
    По умолчанию: 'name'

  • hierarchical(true|false)
    Whether the taxonomy is hierarchical.
    По умолчанию: true

  • show_option_none(строка)
    Label to display if there are no terms.
    По умолчанию: 'None'
$taxonomy(строка)
The taxonomy slug.
$context(строка)
Filter context. Accepts 'new' or 'edit'.

Список изменений

С версии 3.7.0 Введена.
С версии 4.2.0 Added $context parameter.

Где вызывается хук

В файле: /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' );

Где используется хук в WordPress

Использование не найдено.