512 | | <?php wp_dropdown_categories( array( 'taxonomy' => $tax_name, 'hide_empty' => 0, 'name' => 'new' . $tax_name . '_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —' ) ); ?> |
| 512 | <?php |
| 513 | $parent_dropdown_args = array( |
| 514 | 'taxonomy' => $tax_name, |
| 515 | 'hide_empty' => 0, |
| 516 | 'name' => 'new' . $tax_name . '_parent', |
| 517 | 'orderby' => 'name', |
| 518 | 'hierarchical' => 1, |
| 519 | 'show_option_none' => '— ' . $taxonomy->labels->parent_item . ' —', |
| 520 | ); |
| 521 | /** |
| 522 | * Filters the taxonomy parent drop-down on the Post Edit page. |
| 523 | * |
| 524 | * @since 4.4.0 |
| 525 | * |
| 526 | * @param array $parent_dropdown_args { |
| 527 | * Optional. Array of arguments to generate a categories drop-down element. |
| 528 | * |
| 529 | * @type string $taxonomy Name of the category to retrieve. Default 'category'. |
| 530 | * @type bool $hide_if_empty True to skip generating markup if no categories are found. |
| 531 | * @type string $name Value for the 'name' attribute of the select element. Default 'cat'. |
| 532 | * @type string $orderby Which column to use for ordering categories. See get_terms() for a list |
| 533 | * of accepted values. Default 'id' (term_id). |
| 534 | * Default false (create select element even if no categories are found). |
| 535 | * @type bool|int $hierarchical Whether to traverse the taxonomy hierarchy. Accepts 0, 1, or their bool |
| 536 | * equivalents. Default 0. |
| 537 | * @type string $show_option_none Text to display for showing no categories. Default empty. |
| 538 | * } |
| 539 | * |
| 540 | */ |
| 541 | $parent_dropdown_args = apply_filters( 'post_edit_category_parent_dropdown_args', $parent_dropdown_args ); |
| 542 | wp_dropdown_categories( $parent_dropdown_args ); |
| 543 | ?> |