taxonomy_parent_dropdown_args WordPress Filter Hook

The taxonomy_parent_dropdown_args Wordpress hook allows developers to modify the default arguments used when generating a dropdown list of parent terms for a given taxonomy. This hook is typically used to add custom arguments such as 'orderby' or 'hide_empty'.

apply_filters( 'taxonomy_parent_dropdown_args', array $dropdown_args, string $taxonomy, string $context ) #

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


Parameters

$dropdown_args

(array)An array of taxonomy parent drop-down arguments.

  • 'hide_empty'
    (int|bool) Whether to hide terms not attached to any posts. Default 0|false.
  • 'hide_if_empty'
    (bool) Whether to hide the drop-down if no terms exist. Default false.
  • 'taxonomy'
    (string) The taxonomy slug.
  • 'name'
    (string) Value of the name attribute to use for the drop-down select element. Default 'parent'.
  • 'orderby'
    (string) The field to order by. Default 'name'.
  • 'hierarchical'
    (bool) Whether the taxonomy is hierarchical. Default true.
  • 'show_option_none'
    (string) Label to display if there are no terms. Default 'None'.

$taxonomy

(string)The taxonomy slug.

$context

(string)Filter context. Accepts 'new' or 'edit'.


Top ↑

Source

File: wp-admin/edit-tags.php

View on Trac


Top ↑

Changelog

Changelog
VersionDescription
4.2.0Added $context parameter.
3.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.