Add 'taxonomy_parent_dropdown_args' filter for the parent dropdown on taxonomy term editing screens. props leewillis77. fixes #18166.

git-svn-id: https://develop.svn.wordpress.org/trunk@25123 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2013-08-26 17:30:46 +00:00
parent 71793b661c
commit a679d43131
1 changed files with 14 additions and 1 deletions

View File

@ -371,7 +371,20 @@ if ( current_user_can($tax->cap->edit_terms) ) {
<?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?> <?php if ( is_taxonomy_hierarchical($taxonomy) ) : ?>
<div class="form-field"> <div class="form-field">
<label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label> <label for="parent"><?php _ex('Parent', 'Taxonomy Parent'); ?></label>
<?php wp_dropdown_categories(array('hide_empty' => 0, 'hide_if_empty' => false, 'taxonomy' => $taxonomy, 'name' => 'parent', 'orderby' => 'name', 'hierarchical' => true, 'show_option_none' => __('None'))); ?> <?php
$dropdown_args = array(
'hide_empty' => 0,
'hide_if_empty' => false,
'taxonomy' => $taxonomy,
'name' => 'parent',
'orderby' => 'name',
'hierarchical' => true,
'show_option_none' => __( 'None' ),
);
$dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy );
wp_dropdown_categories( $dropdown_args );
?>
<?php if ( 'category' == $taxonomy ) : // @todo: Generic text for hierarchical taxonomies ?> <?php if ( 'category' == $taxonomy ) : // @todo: Generic text for hierarchical taxonomies ?>
<p><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></p> <p><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></p>
<?php endif; ?> <?php endif; ?>