X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/wordpress.git/blobdiff_plain/dc1231b7312fbdca99e9e887cc2bb35a28f85cdc..3d39054f012aefe514b3f5509e32f09fc4feda44:/wp-includes/category-template.php?ds=sidebyside
diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index 6bac6c11..7063c2d4 100644
--- a/wp-includes/category-template.php
+++ b/wp-includes/category-template.php
@@ -1,9 +1,10 @@
` element should have the HTML5 'required' attribute.
+ * Default false.
* }
* @return string HTML content only if 'echo' argument is 0.
*/
function wp_dropdown_categories( $args = '' ) {
$defaults = array(
- 'show_option_all' => '', 'show_option_none' => '',
- 'orderby' => 'id', 'order' => 'ASC',
- 'show_count' => 0,
- 'hide_empty' => 1, 'child_of' => 0,
- 'exclude' => '', 'echo' => 1,
- 'selected' => 0, 'hierarchical' => 0,
- 'name' => 'cat', 'id' => '',
- 'class' => 'postform', 'depth' => 0,
- 'tab_index' => 0, 'taxonomy' => 'category',
- 'hide_if_empty' => false, 'option_none_value' => -1,
- 'value_field' => 'term_id',
+ 'show_option_all' => '',
+ 'show_option_none' => '',
+ 'orderby' => 'id',
+ 'order' => 'ASC',
+ 'show_count' => 0,
+ 'hide_empty' => 1,
+ 'child_of' => 0,
+ 'exclude' => '',
+ 'echo' => 1,
+ 'selected' => 0,
+ 'hierarchical' => 0,
+ 'name' => 'cat',
+ 'id' => '',
+ 'class' => 'postform',
+ 'depth' => 0,
+ 'tab_index' => 0,
+ 'taxonomy' => 'category',
+ 'hide_if_empty' => false,
+ 'option_none_value' => -1,
+ 'value_field' => 'term_id',
+ 'required' => false,
);
$defaults['selected'] = ( is_category() ) ? get_query_var( 'cat' ) : 0;
// Back compat.
if ( isset( $args['type'] ) && 'link' == $args['type'] ) {
- _deprecated_argument( __FUNCTION__, '3.0', '' );
+ /* translators: 1: "type => link", 2: "taxonomy => link_category" alternative */
+ _deprecated_argument( __FUNCTION__, '3.0.0',
+ sprintf( __( '%1$s is deprecated. Use %2$s instead.' ),
+ 'type => link
',
+ 'taxonomy => link_category
'
+ )
+ );
$args['taxonomy'] = 'link_category';
}
@@ -386,16 +418,17 @@ function wp_dropdown_categories( $args = '' ) {
$name = esc_attr( $r['name'] );
$class = esc_attr( $r['class'] );
$id = $r['id'] ? esc_attr( $r['id'] ) : $name;
+ $required = $r['required'] ? 'required' : '';
if ( ! $r['hide_if_empty'] || ! empty( $categories ) ) {
- $output = "