Make WordPress Core

Ticket #33026: 33026.2.patch

File 33026.2.patch, 4.0 KB (added by theMikeD, 8 years ago)
  • src/wp-includes/category-template.php

     
    360360        }
    361361
    362362        $r = wp_parse_args( $args, $defaults );
     363
     364
     365        /**
     366         * Filter the taxonomy parent drop-down on the Post Edit page.
     367         *
     368         * @since 3.7.0
     369         *
     370         * @param string|array $args {
     371         *     Optional. Array or string of arguments to generate a categories drop-down element.
     372         *
     373         *     @type string       $show_option_all   Text to display for showing all categories. Default empty.
     374         *     @type string       $show_option_none  Text to display for showing no categories. Default empty.
     375         *     @type string       $option_none_value Value to use when no category is selected. Default empty.
     376         *     @type string       $orderby           Which column to use for ordering categories. See get_terms() for a list
     377         *                                           of accepted values. Default 'id' (term_id).
     378         *     @type string       $order             Whether to order terms in ascending or descending order. Accepts 'ASC'
     379         *                                           or 'DESC'. Default 'ASC'.
     380         *     @type bool         $pad_counts        See get_terms() for an argument description. Default false.
     381         *     @type bool|int     $show_count        Whether to include post counts. Accepts 0, 1, or their bool equivalents.
     382         *                                           Default 0.
     383         *     @type bool|int     $hide_empty        Whether to hide categories that don't have any posts. Accepts 0, 1, or
     384         *                                           their bool equivalents. Default 1.
     385         *     @type int          $child_of          Term ID to retrieve child terms of. See get_terms(). Default 0.
     386         *     @type array|string $exclude           Array or comma/space-separated string of term ids to exclude.
     387         *                                           If `$include` is non-empty, `$exclude` is ignored. Default empty array.
     388         *     @type bool|int     $echo              Whether to echo or return the generated markup. Accepts 0, 1, or their
     389         *                                           bool equivalents. Default 1.
     390         *     @type bool|int     $hierarchical      Whether to traverse the taxonomy hierarchy. Accepts 0, 1, or their bool
     391         *                                           equivalents. Default 0.
     392         *     @type int          $depth             Maximum depth. Default 0.
     393         *     @type int          $tab_index         Tab index for the select element. Default 0 (no tabindex).
     394         *     @type string       $name              Value for the 'name' attribute of the select element. Default 'cat'.
     395         *     @type string       $id                Value for the 'id' attribute of the select element. Defaults to the value
     396         *                                           of `$name`.
     397         *     @type string       $class             Value for the 'class' attribute of the select element. Default 'postform'.
     398         *     @type int|string   $selected          Value of the option that should be selected. Default 0.
     399         *     @type string       $value_field       Term field that should be used to populate the 'value' attribute
     400         *                                           of the option elements. Accepts any valid term field: 'term_id', 'name',
     401         *                                           'slug', 'term_group', 'term_taxonomy_id', 'taxonomy', 'description',
     402         *                                           'parent', 'count'. Default 'term_id'.
     403         *     @type string       $taxonomy          Name of the category to retrieve. Default 'category'.
     404         *     @type bool         $hide_if_empty     True to skip generating markup if no categories are found.
     405         *                                           Default false (create select element even if no categories are found).
     406         * }
     407         *
     408         */
     409        $r = apply_filters( 'taxonomy_parent_dropdown_post_edit_args', $r);
     410
    363411        $option_none_value = $r['option_none_value'];
    364412
    365413        if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {