wppaste
WordPress

apply_filters( 'post_edit_category_parent_dropdown_args', array $parent_dropdown_args )

Since
4.4.0
Filters the arguments for the taxonomy parent dropdown on the Post Edit page.

Compatibility

WordPress
since 4.4.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$parent_dropdown_argsarray
{ 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.
}
  • $taxonomystring

    Name of the taxonomy to retrieve.
  • $hide_if_emptybool

    True to skip generating markup if no categories are found. Default 0.
  • $namestring

    Value for the 'name' attribute of the select element. Default "new{$tax_name}_parent".
  • $orderbystring

    Which column to use for ordering terms. Default 'name'.
  • $hierarchicalbool|int

    Whether to traverse the taxonomy hierarchy. Default 1.
  • $show_option_nonestring

    Text to display for the "none" option. Default "— {$parent} —", where $parent is 'parent_item' taxonomy label.

Where this hook fires · 2

  • wp-admin/includes/ajax-actions.php:721_wp_ajax_add_hierarchical_term()
  • wp-admin/includes/meta-boxes.php:724post_categories_meta_box()

Source code

					 *     @type string   $show_option_none Text to display for the "none" option.					 *                                      Default "&mdash; {$parent} &mdash;",					 *                                      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="<?php echo $tax_name; ?>-add-submit" data-wp-lists="add:<?php echo $tax_name; ?>checklist:<?php echo $tax_name; ?>-add" class="button category-add-submit" value="<?php echo esc_attr( $taxonomy->labels->add_new_item ); ?>" />					<?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?>					<span id="<?php echo $tax_name; ?>-ajax-response"></span>

Changelog

Introduced in 4.4.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.