<div id="-all" class="tabs-panel" role="tabpanel">
<?php
$name = ( 'category' === $tax_name ) ? 'post_category' : 'tax_input[' . $tax_name . ']';
// Allows for an empty term set to be sent. 0 is an invalid term ID and will be ignored by empty() checks.
echo "";
?>
<ul id="checklist" data-wp-lists="list:" class="categorychecklist form-no-clear">
ID,
array(
'taxonomy' => $tax_name,
'popular_cats' => $popular_ids,
)
);
?>
cap->edit_terms ) ) : ?>
<div id="-adder" class="wp-hidden-children">
<a id="-add-toggle" href="#-add" class="hide-if-no-js taxonomy-add-new">
labels->add_new_item );
?>
<p id="-add" class="category-add wp-hidden-child">
<label class="screen-reader-text" for="new">labels->add_new_item; ?>
<input type="text" name="new" id="new" class="form-required form-input-tip" value="labels->new_item_name ); ?>" aria-required="true" />
<label class="screen-reader-text" for="new_parent">
labels->parent_item_colon; ?>
$tax_name,
'hide_empty' => 0,
'name' => 'new' . $tax_name . '_parent',
'orderby' => 'name',
'hierarchical' => 1,
'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —',
);
/**
* Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
*
* @since 4.4.0
*
* @param array $parent_dropdown_args {
* Optional. Array of arguments to generate parent dropdown.
*
* @type string $taxonomy Name of the taxonomy to retrieve.
* @type bool $hide_if_empty True to skip generating markup if no
* categories are found. Default 0.
* @type string $name Value for the 'name' attribute
* of the select element.
* Default "new{$tax_name}_parent".
* @type string $orderby Which column to use for ordering
* terms. Default 'name'.
* @type bool|int $hierarchical Whether to traverse the taxonomy
* hierarchy. Default 1.
* @type string $show_option_none Text to display for the "none" option.
* Default "— {$parent} —",
* where `$parent` is 'parent_item'
* taxonomy label.
* }
*/
$parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args );
wp_dropdown_categories( $parent_dropdown_args );
?>
<input type="button" id="-add-submit" data-wp-lists="add:checklist:-add" class="button category-add-submit" value="labels->add_new_item ); ?>" />
<span id="-ajax-response">
<?php
}
View all references View on Trac View on GitHub
Hooks apply_filters( ‘post_edit_category_parent_dropdown_args’, array $parent_dropdown_args )Filters the arguments for the taxonomy parent dropdown on the Post Edit page.
Related UsesDescriptionwp_popular_terms_checklist()wp-admin/includes/template.phpRetrieves a list of the most popular terms from the specified taxonomy.
wp_terms_checklist()wp-admin/includes/template.phpOutputs an unordered list of checkbox input elements labelled with term names.
wp_dropdown_categories()wp-includes/category-template.phpDisplays or retrieves the HTML dropdown list of categories.
wp_nonce_field()wp-includes/functions.phpRetrieves or display nonce hidden field for forms.
current_user_can()wp-includes/capabilities.phpReturns whether the current user has the specified capability.
__()wp-includes/l10n.phpRetrieves the translation of $text.
esc_attr()wp-includes/formatting.phpEscaping for HTML attributes.
esc_html()wp-includes/formatting.phpEscaping for HTML blocks.
wp_parse_args()wp-includes/functions.phpMerges user defined arguments into defaults array.
get_taxonomy()wp-includes/taxonomy.phpRetrieves the taxonomy object of $taxonomy.
apply_filters()wp-includes/plugin.phpCalls the callback functions that have been added to a filter hook.
Show 7 moreShow less
Changelog VersionDescription2.6.0Introduced.
Сайт использует необходимые cookie. Аналитические cookie сервиса Яндекс Метрика (ООО «ЯНДЕКС») применяются только с вашего согласия; отозвать его можно в «Настройках cookie» внизу страницы. Подробнее — в Политике обработки персональных данных.