taxonomy_parent_dropdown_args
Filter HookDescription
Filters the editable slug for a post or term. Note: This is a multi-use hook in that it is leveraged both for editable post URIs and term slugs.Hook Information
File Location |
wp-admin/edit-tag-form.php
View on GitHub
|
Hook Type | Filter |
Line Number | 194 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$slug
|
The editable slug. Will be either a term slug or post URI depending upon the context in which it is evaluated. |
WP_Term|WP_Post
|
$tag
|
Term or post object. |
Usage Examples
Basic Usage
<?php
// Hook into taxonomy_parent_dropdown_args
add_filter('taxonomy_parent_dropdown_args', 'my_custom_filter', 10, 2);
function my_custom_filter($slug, $tag) {
// Your custom filtering logic here
return $slug;
}
Source Code Context
wp-admin/edit-tag-form.php:194
- How this hook is used in WordPress core
<?php
189 'show_option_none' => __( 'None' ),
190 'aria_describedby' => 'parent-description',
191 );
192
193 /** This filter is documented in wp-admin/edit-tags.php */
194 $dropdown_args = apply_filters( 'taxonomy_parent_dropdown_args', $dropdown_args, $taxonomy, 'edit' );
195 wp_dropdown_categories( $dropdown_args );
196 ?>
197 <?php if ( 'category' === $taxonomy ) : ?>
198 <p class="description" id="parent-description"><?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>
199 <?php else : ?>
PHP Documentation
<?php
/**
* Filters the editable slug for a post or term.
*
* Note: This is a multi-use hook in that it is leveraged both for editable
* post URIs and term slugs.
*
* @since 2.6.0
* @since 4.4.0 The `$tag` parameter was added.
*
* @param string $slug The editable slug. Will be either a term slug or post URI depending
* upon the context in which it is evaluated.
* @param WP_Term|WP_Post $tag Term or post object.
*/
Quick Info
- Hook Type: Filter
- Parameters: 2
- File: wp-admin/edit-tag-form.php
Related Hooks
Related hooks will be displayed here in future updates.