diff --git a/wp-admin/includes/bookmark.php b/wp-admin/includes/bookmark.php index fa425dda04..05165dd9d1 100644 --- a/wp-admin/includes/bookmark.php +++ b/wp-admin/includes/bookmark.php @@ -162,12 +162,12 @@ function wp_insert_link( $linkdata, $wp_error = false ) { 'link_rating' => 0, ); - $args = wp_parse_args( $linkdata, $defaults ); - $r = wp_unslash( sanitize_bookmark( $args, 'db' ) ); + $parsed_args = wp_parse_args( $linkdata, $defaults ); + $parsed_args = wp_unslash( sanitize_bookmark( $parsed_args, 'db' ) ); - $link_id = $r['link_id']; - $link_name = $r['link_name']; - $link_url = $r['link_url']; + $link_id = $parsed_args['link_id']; + $link_name = $parsed_args['link_name']; + $link_url = $parsed_args['link_url']; $update = false; if ( ! empty( $link_id ) ) { @@ -186,16 +186,16 @@ function wp_insert_link( $linkdata, $wp_error = false ) { return 0; } - $link_rating = ( ! empty( $r['link_rating'] ) ) ? $r['link_rating'] : 0; - $link_image = ( ! empty( $r['link_image'] ) ) ? $r['link_image'] : ''; - $link_target = ( ! empty( $r['link_target'] ) ) ? $r['link_target'] : ''; - $link_visible = ( ! empty( $r['link_visible'] ) ) ? $r['link_visible'] : 'Y'; - $link_owner = ( ! empty( $r['link_owner'] ) ) ? $r['link_owner'] : get_current_user_id(); - $link_notes = ( ! empty( $r['link_notes'] ) ) ? $r['link_notes'] : ''; - $link_description = ( ! empty( $r['link_description'] ) ) ? $r['link_description'] : ''; - $link_rss = ( ! empty( $r['link_rss'] ) ) ? $r['link_rss'] : ''; - $link_rel = ( ! empty( $r['link_rel'] ) ) ? $r['link_rel'] : ''; - $link_category = ( ! empty( $r['link_category'] ) ) ? $r['link_category'] : array(); + $link_rating = ( ! empty( $parsed_args['link_rating'] ) ) ? $parsed_args['link_rating'] : 0; + $link_image = ( ! empty( $parsed_args['link_image'] ) ) ? $parsed_args['link_image'] : ''; + $link_target = ( ! empty( $parsed_args['link_target'] ) ) ? $parsed_args['link_target'] : ''; + $link_visible = ( ! empty( $parsed_args['link_visible'] ) ) ? $parsed_args['link_visible'] : 'Y'; + $link_owner = ( ! empty( $parsed_args['link_owner'] ) ) ? $parsed_args['link_owner'] : get_current_user_id(); + $link_notes = ( ! empty( $parsed_args['link_notes'] ) ) ? $parsed_args['link_notes'] : ''; + $link_description = ( ! empty( $parsed_args['link_description'] ) ) ? $parsed_args['link_description'] : ''; + $link_rss = ( ! empty( $parsed_args['link_rss'] ) ) ? $parsed_args['link_rss'] : ''; + $link_rel = ( ! empty( $parsed_args['link_rel'] ) ) ? $parsed_args['link_rel'] : ''; + $link_category = ( ! empty( $parsed_args['link_category'] ) ) ? $parsed_args['link_category'] : array(); // Make sure we set a valid category. if ( ! is_array( $link_category ) || 0 == count( $link_category ) ) { diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index d6a2116bb8..5c2f346e35 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1493,7 +1493,8 @@ function get_media_item( $attachment_id, $args = null ) { 'toggle' => true, 'show_title' => true, ); - $args = wp_parse_args( $args, $default_args ); + + $parsed_args = wp_parse_args( $args, $default_args ); /** * Filters the arguments used to retrieve an image for the edit image form. @@ -1502,9 +1503,9 @@ function get_media_item( $attachment_id, $args = null ) { * * @see get_media_item * - * @param array $args An array of arguments. + * @param array $parsed_args An array of arguments. */ - $r = apply_filters( 'get_media_item_args', $args ); + $parsed_args = apply_filters( 'get_media_item_args', $parsed_args ); $toggle_on = __( 'Show' ); $toggle_off = __( 'Hide' ); @@ -1518,10 +1519,10 @@ function get_media_item( $attachment_id, $args = null ) { $type = reset( $keys ); $type_html = ""; - $form_fields = get_attachment_fields_to_edit( $post, $r['errors'] ); + $form_fields = get_attachment_fields_to_edit( $post, $parsed_args['errors'] ); - if ( $r['toggle'] ) { - $class = empty( $r['errors'] ) ? 'startclosed' : 'startopen'; + if ( $parsed_args['toggle'] ) { + $class = empty( $parsed_args['errors'] ) ? 'startclosed' : 'startopen'; $toggle_links = " $toggle_on $toggle_off"; @@ -1531,7 +1532,7 @@ function get_media_item( $attachment_id, $args = null ) { } $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case - $display_title = $r['show_title'] ? "
" . wp_html_excerpt( $display_title, 60, '…' ) . '
' : ''; + $display_title = $parsed_args['show_title'] ? "
" . wp_html_excerpt( $display_title, 60, '…' ) . '
' : ''; $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) ); $order = ''; @@ -1609,11 +1610,11 @@ function get_media_item( $attachment_id, $args = null ) { 'extra_rows' => array(), ); - if ( $r['send'] ) { - $r['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false ); + if ( $parsed_args['send'] ) { + $parsed_args['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false ); } - $delete = empty( $r['delete'] ) ? '' : $r['delete']; + $delete = empty( $parsed_args['delete'] ) ? '' : $parsed_args['delete']; if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) { if ( ! EMPTY_TRASH_DAYS ) { $delete = "" . __( 'Delete Permanently' ) . ''; @@ -1650,8 +1651,8 @@ function get_media_item( $attachment_id, $args = null ) { $thumbnail = "" . esc_html( $calling_post_type_object->labels->use_featured_image ) . ''; } - if ( ( $r['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) { - $form_fields['buttons'] = array( 'tr' => "\t\t" . $r['send'] . " $thumbnail $delete\n" ); + if ( ( $parsed_args['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) { + $form_fields['buttons'] = array( 'tr' => "\t\t" . $parsed_args['send'] . " $thumbnail $delete\n" ); } $hidden_fields = array(); diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 2433b3c531..9a5e935d4c 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -492,9 +492,9 @@ function post_tags_meta_box( $post, $box ) { } else { $args = $box['args']; } - $r = wp_parse_args( $args, $defaults ); - $tax_name = esc_attr( $r['taxonomy'] ); - $taxonomy = get_taxonomy( $r['taxonomy'] ); + $parsed_args = wp_parse_args( $args, $defaults ); + $tax_name = esc_attr( $parsed_args['taxonomy'] ); + $taxonomy = get_taxonomy( $parsed_args['taxonomy'] ); $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms ); $comma = _x( ',', 'tag delimiter' ); $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name ); @@ -555,9 +555,9 @@ function post_categories_meta_box( $post, $box ) { } else { $args = $box['args']; } - $r = wp_parse_args( $args, $defaults ); - $tax_name = esc_attr( $r['taxonomy'] ); - $taxonomy = get_taxonomy( $r['taxonomy'] ); + $parsed_args = wp_parse_args( $args, $defaults ); + $tax_name = esc_attr( $parsed_args['taxonomy'] ); + $taxonomy = get_taxonomy( $parsed_args['taxonomy'] ); ?>
'; - if ( $r['echo'] ) { + if ( $parsed_args['echo'] ) { echo $output; } diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php index 85804125fb..8975a004d2 100644 --- a/wp-includes/bookmark-template.php +++ b/wp-includes/bookmark-template.php @@ -62,7 +62,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) { 'link_after' => '', ); - $r = wp_parse_args( $args, $defaults ); + $parsed_args = wp_parse_args( $args, $defaults ); $output = ''; // Blank string to start with. @@ -70,8 +70,8 @@ function _walk_bookmarks( $bookmarks, $args = '' ) { if ( ! isset( $bookmark->recently_updated ) ) { $bookmark->recently_updated = false; } - $output .= $r['before']; - if ( $r['show_updated'] && $bookmark->recently_updated ) { + $output .= $parsed_args['before']; + if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) { $output .= ''; } $the_link = '#'; @@ -82,7 +82,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) { $name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) ); $title = $desc; - if ( $r['show_updated'] ) { + if ( $parsed_args['show_updated'] ) { if ( '00' != substr( $bookmark->link_updated_f, 0, 2 ) ) { $title .= ' ('; $title .= sprintf( @@ -95,7 +95,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) { $title .= ')'; } } - $alt = ' alt="' . $name . ( $r['show_description'] ? ' ' . $title : '' ) . '"'; + $alt = ' alt="' . $name . ( $parsed_args['show_description'] ? ' ' . $title : '' ) . '"'; if ( '' != $title ) { $title = ' title="' . $title . '"'; @@ -110,42 +110,42 @@ function _walk_bookmarks( $bookmarks, $args = '' ) { } $output .= ''; - $output .= $r['link_before']; + $output .= $parsed_args['link_before']; - if ( $bookmark->link_image != null && $r['show_images'] ) { + if ( $bookmark->link_image != null && $parsed_args['show_images'] ) { if ( strpos( $bookmark->link_image, 'http' ) === 0 ) { $output .= "link_image\" $alt $title />"; } else { // If it's a relative path $output .= 'link_image\" $alt $title />"; } - if ( $r['show_name'] ) { + if ( $parsed_args['show_name'] ) { $output .= " $name"; } } else { $output .= $name; } - $output .= $r['link_after']; + $output .= $parsed_args['link_after']; $output .= ''; - if ( $r['show_updated'] && $bookmark->recently_updated ) { + if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) { $output .= ''; } - if ( $r['show_description'] && '' != $desc ) { - $output .= $r['between'] . $desc; + if ( $parsed_args['show_description'] && '' != $desc ) { + $output .= $parsed_args['between'] . $desc; } - if ( $r['show_rating'] ) { - $output .= $r['between'] . sanitize_bookmark_field( + if ( $parsed_args['show_rating'] ) { + $output .= $parsed_args['between'] . sanitize_bookmark_field( 'link_rating', $bookmark->link_rating, $bookmark->link_id, 'display' ); } - $output .= $r['after'] . "\n"; + $output .= $parsed_args['after'] . "\n"; } // end while return $output; @@ -225,45 +225,45 @@ function wp_list_bookmarks( $args = '' ) { 'category_after' => '', ); - $r = wp_parse_args( $args, $defaults ); + $parsed_args = wp_parse_args( $args, $defaults ); $output = ''; - if ( ! is_array( $r['class'] ) ) { - $r['class'] = explode( ' ', $r['class'] ); + if ( ! is_array( $parsed_args['class'] ) ) { + $parsed_args['class'] = explode( ' ', $parsed_args['class'] ); } - $r['class'] = array_map( 'sanitize_html_class', $r['class'] ); - $r['class'] = trim( join( ' ', $r['class'] ) ); + $parsed_args['class'] = array_map( 'sanitize_html_class', $parsed_args['class'] ); + $parsed_args['class'] = trim( join( ' ', $parsed_args['class'] ) ); - if ( $r['categorize'] ) { + if ( $parsed_args['categorize'] ) { $cats = get_terms( 'link_category', array( - 'name__like' => $r['category_name'], - 'include' => $r['category'], - 'exclude' => $r['exclude_category'], - 'orderby' => $r['category_orderby'], - 'order' => $r['category_order'], + 'name__like' => $parsed_args['category_name'], + 'include' => $parsed_args['category'], + 'exclude' => $parsed_args['exclude_category'], + 'orderby' => $parsed_args['category_orderby'], + 'order' => $parsed_args['category_order'], 'hierarchical' => 0, ) ); if ( empty( $cats ) ) { - $r['categorize'] = false; + $parsed_args['categorize'] = false; } } - if ( $r['categorize'] ) { + if ( $parsed_args['categorize'] ) { // Split the bookmarks into ul's for each category foreach ( (array) $cats as $cat ) { - $params = array_merge( $r, array( 'category' => $cat->term_id ) ); + $params = array_merge( $parsed_args, array( 'category' => $cat->term_id ) ); $bookmarks = get_bookmarks( $params ); if ( empty( $bookmarks ) ) { continue; } $output .= str_replace( array( '%id', '%class' ), - array( "linkcat-$cat->term_id", $r['class'] ), - $r['category_before'] + array( "linkcat-$cat->term_id", $parsed_args['class'] ), + $parsed_args['category_before'] ); /** * Filters the category name. @@ -274,34 +274,34 @@ function wp_list_bookmarks( $args = '' ) { */ $catname = apply_filters( 'link_category', $cat->name ); - $output .= $r['title_before']; + $output .= $parsed_args['title_before']; $output .= $catname; - $output .= $r['title_after']; + $output .= $parsed_args['title_after']; $output .= "\n\t\n"; - $output .= $r['category_after'] . "\n"; + $output .= $parsed_args['category_after'] . "\n"; } } else { //output one single list using title_li for the title - $bookmarks = get_bookmarks( $r ); + $bookmarks = get_bookmarks( $parsed_args ); if ( ! empty( $bookmarks ) ) { - if ( ! empty( $r['title_li'] ) ) { + if ( ! empty( $parsed_args['title_li'] ) ) { $output .= str_replace( array( '%id', '%class' ), - array( 'linkcat-' . $r['category'], $r['class'] ), - $r['category_before'] + array( 'linkcat-' . $parsed_args['category'], $parsed_args['class'] ), + $parsed_args['category_before'] ); - $output .= $r['title_before']; - $output .= $r['title_li']; - $output .= $r['title_after']; + $output .= $parsed_args['title_before']; + $output .= $parsed_args['title_li']; + $output .= $parsed_args['title_after']; $output .= "\n\t\n"; - $output .= $r['category_after'] . "\n"; + $output .= $parsed_args['category_after'] . "\n"; } else { - $output .= _walk_bookmarks( $bookmarks, $r ); + $output .= _walk_bookmarks( $bookmarks, $parsed_args ); } } } @@ -315,7 +315,7 @@ function wp_list_bookmarks( $args = '' ) { */ $html = apply_filters( 'wp_list_bookmarks', $output ); - if ( ! $r['echo'] ) { + if ( ! $parsed_args['echo'] ) { return $html; } echo $html; diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php index fee37ce109..fd2c926591 100644 --- a/wp-includes/bookmark.php +++ b/wp-includes/bookmark.php @@ -139,11 +139,12 @@ function get_bookmarks( $args = '' ) { 'search' => '', ); - $r = wp_parse_args( $args, $defaults ); + $parsed_args = wp_parse_args( $args, $defaults ); - $key = md5( serialize( $r ) ); + $key = md5( serialize( $parsed_args ) ); $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ); - if ( 'rand' !== $r['orderby'] && $cache ) { + + if ( 'rand' !== $parsed_args['orderby'] && $cache ) { if ( is_array( $cache ) && isset( $cache[ $key ] ) ) { $bookmarks = $cache[ $key ]; /** @@ -159,9 +160,9 @@ function get_bookmarks( $args = '' ) { * @see get_bookmarks() * * @param array $bookmarks List of the cached bookmarks. - * @param array $r An array of bookmark query arguments. + * @param array $parsed_args An array of bookmark query arguments. */ - return apply_filters( 'get_bookmarks', $bookmarks, $r ); + return apply_filters( 'get_bookmarks', $bookmarks, $parsed_args ); } } @@ -170,11 +171,12 @@ function get_bookmarks( $args = '' ) { } $inclusions = ''; - if ( ! empty( $r['include'] ) ) { - $r['exclude'] = ''; //ignore exclude, category, and category_name params if using include - $r['category'] = ''; - $r['category_name'] = ''; - $inclinks = wp_parse_id_list( $r['include'] ); + if ( ! empty( $parsed_args['include'] ) ) { + $parsed_args['exclude'] = ''; //ignore exclude, category, and category_name params if using include + $parsed_args['category'] = ''; + $parsed_args['category_name'] = ''; + + $inclinks = wp_parse_id_list( $parsed_args['include'] ); if ( count( $inclinks ) ) { foreach ( $inclinks as $inclink ) { if ( empty( $inclusions ) ) { @@ -190,8 +192,8 @@ function get_bookmarks( $args = '' ) { } $exclusions = ''; - if ( ! empty( $r['exclude'] ) ) { - $exlinks = wp_parse_id_list( $r['exclude'] ); + if ( ! empty( $parsed_args['exclude'] ) ) { + $exlinks = wp_parse_id_list( $parsed_args['exclude'] ); if ( count( $exlinks ) ) { foreach ( $exlinks as $exlink ) { if ( empty( $exclusions ) ) { @@ -206,28 +208,28 @@ function get_bookmarks( $args = '' ) { $exclusions .= ')'; } - if ( ! empty( $r['category_name'] ) ) { - $r['category'] = get_term_by( 'name', $r['category_name'], 'link_category' ); - if ( $r['category'] ) { - $r['category'] = $r['category']->term_id; + if ( ! empty( $parsed_args['category_name'] ) ) { + $parsed_args['category'] = get_term_by( 'name', $parsed_args['category_name'], 'link_category' ); + if ( $parsed_args['category'] ) { + $parsed_args['category'] = $parsed_args['category']->term_id; } else { $cache[ $key ] = array(); wp_cache_set( 'get_bookmarks', $cache, 'bookmark' ); /** This filter is documented in wp-includes/bookmark.php */ - return apply_filters( 'get_bookmarks', array(), $r ); + return apply_filters( 'get_bookmarks', array(), $parsed_args ); } } $search = ''; - if ( ! empty( $r['search'] ) ) { - $like = '%' . $wpdb->esc_like( $r['search'] ) . '%'; + if ( ! empty( $parsed_args['search'] ) ) { + $like = '%' . $wpdb->esc_like( $parsed_args['search'] ) . '%'; $search = $wpdb->prepare( ' AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ', $like, $like, $like ); } $category_query = ''; $join = ''; - if ( ! empty( $r['category'] ) ) { - $incategories = wp_parse_id_list( $r['category'] ); + if ( ! empty( $parsed_args['category'] ) ) { + $incategories = wp_parse_id_list( $parsed_args['category'] ); if ( count( $incategories ) ) { foreach ( $incategories as $incat ) { if ( empty( $category_query ) ) { @@ -243,15 +245,15 @@ function get_bookmarks( $args = '' ) { $join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id"; } - if ( $r['show_updated'] ) { + if ( $parsed_args['show_updated'] ) { $recently_updated_test = ', IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated '; } else { $recently_updated_test = ''; } - $get_updated = ( $r['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : ''; + $get_updated = ( $parsed_args['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : ''; - $orderby = strtolower( $r['orderby'] ); + $orderby = strtolower( $parsed_args['orderby'] ); $length = ''; switch ( $orderby ) { case 'length': @@ -282,21 +284,21 @@ function get_bookmarks( $args = '' ) { $orderby = 'link_name'; } - $order = strtoupper( $r['order'] ); + $order = strtoupper( $parsed_args['order'] ); if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ) ) ) { $order = 'ASC'; } $visible = ''; - if ( $r['hide_invisible'] ) { + if ( $parsed_args['hide_invisible'] ) { $visible = "AND link_visible = 'Y'"; } $query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query"; $query .= " $exclusions $inclusions $search"; $query .= " ORDER BY $orderby $order"; - if ( $r['limit'] != -1 ) { - $query .= ' LIMIT ' . $r['limit']; + if ( $parsed_args['limit'] != -1 ) { + $query .= ' LIMIT ' . $parsed_args['limit']; } $results = $wpdb->get_results( $query ); @@ -307,7 +309,7 @@ function get_bookmarks( $args = '' ) { } /** This filter is documented in wp-includes/bookmark.php */ - return apply_filters( 'get_bookmarks', $results, $r ); + return apply_filters( 'get_bookmarks', $results, $parsed_args ); } /** diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php index 1b2da3c122..fd06fa14e5 100644 --- a/wp-includes/category-template.php +++ b/wp-includes/category-template.php @@ -365,14 +365,15 @@ function wp_dropdown_categories( $args = '' ) { $args['taxonomy'] = 'link_category'; } - $r = wp_parse_args( $args, $defaults ); - $option_none_value = $r['option_none_value']; + // Parse incoming $args into an array and merge it with $defaults + $parsed_args = wp_parse_args( $args, $defaults ); + $option_none_value = $args['option_none_value']; - if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { - $r['pad_counts'] = true; + if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) { + $parsed_args['pad_counts'] = true; } - $tab_index = $r['tab_index']; + $tab_index = $parsed_args['tab_index']; $tab_index_attribute = ''; if ( (int) $tab_index > 0 ) { @@ -380,21 +381,21 @@ function wp_dropdown_categories( $args = '' ) { } // Avoid clashes with the 'name' param of get_terms(). - $get_terms_args = $r; + $get_terms_args = $parsed_args; unset( $get_terms_args['name'] ); - $categories = get_terms( $r['taxonomy'], $get_terms_args ); + $categories = get_terms( $parsed_args['taxonomy'], $get_terms_args ); - $name = esc_attr( $r['name'] ); - $class = esc_attr( $r['class'] ); - $id = $r['id'] ? esc_attr( $r['id'] ) : $name; - $required = $r['required'] ? 'required' : ''; + $name = esc_attr( $parsed_args['name'] ); + $class = esc_attr( $parsed_args['class'] ); + $id = $parsed_args['id'] ? esc_attr( $parsed_args['id'] ) : $name; + $required = $parsed_args['required'] ? 'required' : ''; - if ( ! $r['hide_if_empty'] || ! empty( $categories ) ) { + if ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) { $output = "\n"; } /** @@ -450,11 +451,11 @@ function wp_dropdown_categories( $args = '' ) { * @since 2.1.0 * * @param string $output HTML output. - * @param array $r Arguments used to build the drop-down. + * @param array $parsed_args Arguments used to build the drop-down. */ - $output = apply_filters( 'wp_dropdown_cats', $output, $r ); + $output = apply_filters( 'wp_dropdown_cats', $output, $parsed_args ); - if ( $r['echo'] ) { + if ( $parsed_args['echo'] ) { echo $output; } return $output; @@ -537,48 +538,48 @@ function wp_list_categories( $args = '' ) { 'use_desc_for_title' => 1, ); - $r = wp_parse_args( $args, $defaults ); + $parsed_args = wp_parse_args( $args, $defaults ); - if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) { - $r['pad_counts'] = true; + if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) { + $parsed_args['pad_counts'] = true; } // Descendants of exclusions should be excluded too. - if ( true == $r['hierarchical'] ) { + if ( true == $parsed_args['hierarchical'] ) { $exclude_tree = array(); - if ( $r['exclude_tree'] ) { - $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude_tree'] ) ); + if ( $parsed_args['exclude_tree'] ) { + $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude_tree'] ) ); } - if ( $r['exclude'] ) { - $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude'] ) ); + if ( $parsed_args['exclude'] ) { + $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude'] ) ); } - $r['exclude_tree'] = $exclude_tree; - $r['exclude'] = ''; + $parsed_args['exclude_tree'] = $exclude_tree; + $parsed_args['exclude'] = ''; } - if ( ! isset( $r['class'] ) ) { - $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy']; + if ( ! isset( $parsed_args['class'] ) ) { + $parsed_args['class'] = ( 'category' == $parsed_args['taxonomy'] ) ? 'categories' : $parsed_args['taxonomy']; } - if ( ! taxonomy_exists( $r['taxonomy'] ) ) { + if ( ! taxonomy_exists( $parsed_args['taxonomy'] ) ) { return false; } - $show_option_all = $r['show_option_all']; - $show_option_none = $r['show_option_none']; + $show_option_all = $parsed_args['show_option_all']; + $show_option_none = $parsed_args['show_option_none']; - $categories = get_categories( $r ); + $categories = get_categories( $parsed_args ); $output = ''; - if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) { - $output = '
  • ' . $r['title_li'] . '