Make WordPress Core

Ticket #45059: 45059.2.patch

File 45059.2.patch, 90.5 KB (added by freewebmentor, 7 years ago)
  • wp-admin/includes/meta-boxes.php

     
    492492        } else {
    493493                $args = $box['args'];
    494494        }
    495         $r                     = wp_parse_args( $args, $defaults );
     495        $parsed_args                    = wp_parse_args( $args, $defaults );
    496496        $tax_name              = esc_attr( $r['taxonomy'] );
    497497        $taxonomy              = get_taxonomy( $r['taxonomy'] );
    498498        $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
     
    555555        } else {
    556556                $args = $box['args'];
    557557        }
    558         $r        = wp_parse_args( $args, $defaults );
     558        $parsed_args       = wp_parse_args( $args, $defaults );
    559559        $tax_name = esc_attr( $r['taxonomy'] );
    560560        $taxonomy = get_taxonomy( $r['taxonomy'] );
    561561        ?>
     
    13101310                <th scope="row"><label for="link_rating"><?php _e( 'Rating' ); ?></label></th>
    13111311                <td><select name="link_rating" id="link_rating" size="1">
    13121312                <?php
    1313                 for ( $r = 0; $r <= 10; $r++ ) {
    1314                         echo '<option value="' . $r . '"';
    1315                         if ( isset( $link->link_rating ) && $link->link_rating == $r ) {
     1313                for ( $parsed_args= 0; $parsed_args<= 10; $r++ ) {
     1314                        echo '<option value="' . $parsed_args. '"';
     1315                        if ( isset( $link->link_rating ) && $link->link_rating == $parsed_args) {
    13161316                                echo ' selected="selected"';
    13171317                        }
    1318                         echo( '>' . $r . '</option>' );
     1318                        echo( '>' . $parsed_args. '</option>' );
    13191319                }
    13201320                ?>
    13211321                </select>&nbsp;<?php _e( '(Leave at 0 for no rating.)' ); ?>
  • wp-admin/includes/ms.php

     
    10911091        );
    10921092
    10931093        // Parse arguments
    1094         $r = wp_parse_args(
     1094        $parsed_args = wp_parse_args(
    10951095                $args,
    10961096                array(
    10971097                        'blog_id'  => isset( $_GET['blog_id'] ) ? (int) $_GET['blog_id'] : 0,
     
    11041104        $screen_links = array();
    11051105
    11061106        // Loop through tabs
    1107         foreach ( $r['links'] as $link_id => $link ) {
     1107        foreach ( $parsed_args['links'] as $link_id => $link ) {
    11081108
    11091109                // Skip link if user can't access
    1110                 if ( ! current_user_can( $link['cap'], $r['blog_id'] ) ) {
     1110                if ( ! current_user_can( $link['cap'], $parsed_args['blog_id'] ) ) {
    11111111                        continue;
    11121112                }
    11131113
     
    11151115                $classes = array( 'nav-tab' );
    11161116
    11171117                // Selected is set by the parent OR assumed by the $pagenow global
    1118                 if ( $r['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
     1118                if ( $parsed_args['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
    11191119                        $classes[] = 'nav-tab-active';
    11201120                }
    11211121
     
    11231123                $esc_classes = implode( ' ', $classes );
    11241124
    11251125                // Get the URL for this link
    1126                 $url = add_query_arg( array( 'id' => $r['blog_id'] ), network_admin_url( $link['url'] ) );
     1126                $url = add_query_arg( array( 'id' => $parsed_args['blog_id'] ), network_admin_url( $link['url'] ) );
    11271127
    11281128                // Add link to nav links
    11291129                $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '">' . esc_html( $link['label'] ) . '</a>';
  • wp-admin/includes/template.php

     
    100100         */
    101101        $params = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
    102102
    103         $r = wp_parse_args( $params, $defaults );
     103        $parsed_args = wp_parse_args( $params, $defaults );
    104104
    105         if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) {
     105        if ( empty( $parsed_args['walker'] ) || ! ( $parsed_args['walker'] instanceof Walker ) ) {
    106106                $walker = new Walker_Category_Checklist;
    107107        } else {
    108                 $walker = $r['walker'];
     108                $walker = $parsed_args['walker'];
    109109        }
    110110
    111         $taxonomy             = $r['taxonomy'];
    112         $descendants_and_self = (int) $r['descendants_and_self'];
     111        $taxonomy             = $parsed_args['taxonomy'];
     112        $descendants_and_self = (int) $parsed_args['descendants_and_self'];
    113113
    114114        $args = array( 'taxonomy' => $taxonomy );
    115115
     
    116116        $tax              = get_taxonomy( $taxonomy );
    117117        $args['disabled'] = ! current_user_can( $tax->cap->assign_terms );
    118118
    119         $args['list_only'] = ! empty( $r['list_only'] );
     119        $args['list_only'] = ! empty( $parsed_args['list_only'] );
    120120
    121         if ( is_array( $r['selected_cats'] ) ) {
    122                 $args['selected_cats'] = $r['selected_cats'];
     121        if ( is_array( $parsed_args['selected_cats'] ) ) {
     122                $args['selected_cats'] = $parsed_args['selected_cats'];
    123123        } elseif ( $post_id ) {
    124124                $args['selected_cats'] = wp_get_object_terms( $post_id, $taxonomy, array_merge( $args, array( 'fields' => 'ids' ) ) );
    125125        } else {
    126126                $args['selected_cats'] = array();
    127127        }
    128         if ( is_array( $r['popular_cats'] ) ) {
    129                 $args['popular_cats'] = $r['popular_cats'];
     128        if ( is_array( $parsed_args['popular_cats'] ) ) {
     129                $args['popular_cats'] = $parsed_args['popular_cats'];
    130130        } else {
    131131                $args['popular_cats'] = get_terms(
    132132                        $taxonomy,
     
    156156
    157157        $output = '';
    158158
    159         if ( $r['checked_ontop'] ) {
     159        if ( $parsed_args['checked_ontop'] ) {
    160160                // Post process $categories rather than adding an exclude to the get_terms() query to keep the query the same across all posts (for any query cache)
    161161                $checked_categories = array();
    162162                $keys               = array_keys( $categories );
     
    174174        // Then the rest of them
    175175        $output .= call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) );
    176176
    177         if ( $r['echo'] ) {
     177        if ( $parsed_args['echo'] ) {
    178178                echo $output;
    179179        }
    180180
     
    23012301                'number' => 0,
    23022302                'echo'   => true,
    23032303        );
    2304         $r        = wp_parse_args( $args, $defaults );
     2304        $parsed_args        = wp_parse_args( $args, $defaults );
    23052305
    23062306        // Non-English decimal places when the $rating is coming from a string
    2307         $rating = (float) str_replace( ',', '.', $r['rating'] );
     2307        $rating = (float) str_replace( ',', '.', $parsed_args['rating'] );
    23082308
    23092309        // Convert Percentage to star rating, 0..5 in .5 increments
    2310         if ( 'percent' === $r['type'] ) {
     2310        if ( 'percent' === $parsed_args['type'] ) {
    23112311                $rating = round( $rating / 10, 0 ) / 2;
    23122312        }
    23132313
     
    23162316        $half_stars  = ceil( $rating - $full_stars );
    23172317        $empty_stars = 5 - $full_stars - $half_stars;
    23182318
    2319         if ( $r['number'] ) {
     2319        if ( $parsed_args['number'] ) {
    23202320                /* translators: 1: the rating, 2: the number of ratings */
    2321                 $format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $r['number'] );
    2322                 $title  = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $r['number'] ) );
     2321                $format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $parsed_args['number'] );
     2322                $title  = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $parsed_args['number'] ) );
    23232323        } else {
    23242324                /* translators: %s: the rating */
    23252325                $title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
     
    23322332        $output .= str_repeat( '<div class="star star-empty" aria-hidden="true"></div>', $empty_stars );
    23332333        $output .= '</div>';
    23342334
    2335         if ( $r['echo'] ) {
     2335        if ( $parsed_args['echo'] ) {
    23362336                echo $output;
    23372337        }
    23382338
  • wp-includes/bookmark-template.php

     
    6262                'link_after'       => '',
    6363        );
    6464
    65         $r = wp_parse_args( $args, $defaults );
     65        $parsed_args = wp_parse_args( $args, $defaults );
    6666
    6767        $output = ''; // Blank string to start with.
    6868
     
    7070                if ( ! isset( $bookmark->recently_updated ) ) {
    7171                        $bookmark->recently_updated = false;
    7272                }
    73                 $output .= $r['before'];
    74                 if ( $r['show_updated'] && $bookmark->recently_updated ) {
     73                $output .= $parsed_args['before'];
     74                if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {
    7575                        $output .= '<em>';
    7676                }
    7777                $the_link = '#';
     
    8282                $name  = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) );
    8383                $title = $desc;
    8484
    85                 if ( $r['show_updated'] ) {
     85                if ( $parsed_args['show_updated'] ) {
    8686                        if ( '00' != substr( $bookmark->link_updated_f, 0, 2 ) ) {
    8787                                $title .= ' (';
    8888                                $title .= sprintf(
     
    9595                                $title .= ')';
    9696                        }
    9797                }
    98                 $alt = ' alt="' . $name . ( $r['show_description'] ? ' ' . $title : '' ) . '"';
     98                $alt = ' alt="' . $name . ( $parsed_args['show_description'] ? ' ' . $title : '' ) . '"';
    9999
    100100                if ( '' != $title ) {
    101101                        $title = ' title="' . $title . '"';
     
    110110                }
    111111                $output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>';
    112112
    113                 $output .= $r['link_before'];
     113                $output .= $parsed_args['link_before'];
    114114
    115                 if ( $bookmark->link_image != null && $r['show_images'] ) {
     115                if ( $bookmark->link_image != null && $parsed_args['show_images'] ) {
    116116                        if ( strpos( $bookmark->link_image, 'http' ) === 0 ) {
    117117                                $output .= "<img src=\"$bookmark->link_image\" $alt $title />";
    118118                        } else { // If it's a relative path
    119119                                $output .= '<img src="' . get_option( 'siteurl' ) . "$bookmark->link_image\" $alt $title />";
    120120                        }
    121                         if ( $r['show_name'] ) {
     121                        if ( $parsed_args['show_name'] ) {
    122122                                $output .= " $name";
    123123                        }
    124124                } else {
     
    125125                        $output .= $name;
    126126                }
    127127
    128                 $output .= $r['link_after'];
     128                $output .= $parsed_args['link_after'];
    129129
    130130                $output .= '</a>';
    131131
    132                 if ( $r['show_updated'] && $bookmark->recently_updated ) {
     132                if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {
    133133                        $output .= '</em>';
    134134                }
    135135
    136                 if ( $r['show_description'] && '' != $desc ) {
    137                         $output .= $r['between'] . $desc;
     136                if ( $parsed_args['show_description'] && '' != $desc ) {
     137                        $output .= $parsed_args['between'] . $desc;
    138138                }
    139139
    140                 if ( $r['show_rating'] ) {
    141                         $output .= $r['between'] . sanitize_bookmark_field(
     140                if ( $parsed_args['show_rating'] ) {
     141                        $output .= $parsed_args['between'] . sanitize_bookmark_field(
    142142                                'link_rating',
    143143                                $bookmark->link_rating,
    144144                                $bookmark->link_id,
     
    145145                                'display'
    146146                        );
    147147                }
    148                 $output .= $r['after'] . "\n";
     148                $output .= $parsed_args['after'] . "\n";
    149149        } // end while
    150150
    151151        return $output;
     
    225225                'category_after'   => '</li>',
    226226        );
    227227
    228         $r = wp_parse_args( $args, $defaults );
     228        $parsed_args = wp_parse_args( $args, $defaults );
    229229
    230230        $output = '';
    231231
    232         if ( ! is_array( $r['class'] ) ) {
    233                 $r['class'] = explode( ' ', $r['class'] );
     232        if ( ! is_array( $parsed_args['class'] ) ) {
     233                $parsed_args['class'] = explode( ' ', $parsed_args['class'] );
    234234        }
    235         $r['class'] = array_map( 'sanitize_html_class', $r['class'] );
    236         $r['class'] = trim( join( ' ', $r['class'] ) );
     235        $parsed_args['class'] = array_map( 'sanitize_html_class', $parsed_args['class'] );
     236        $parsed_args['class'] = trim( join( ' ', $parsed_args['class'] ) );
    237237
    238         if ( $r['categorize'] ) {
     238        if ( $parsed_args['categorize'] ) {
    239239                $cats = get_terms(
    240240                        'link_category',
    241241                        array(
    242                                 'name__like'   => $r['category_name'],
    243                                 'include'      => $r['category'],
    244                                 'exclude'      => $r['exclude_category'],
    245                                 'orderby'      => $r['category_orderby'],
    246                                 'order'        => $r['category_order'],
     242                                'name__like'   => $parsed_args['category_name'],
     243                                'include'      => $parsed_args['category'],
     244                                'exclude'      => $parsed_args['exclude_category'],
     245                                'orderby'      => $parsed_args['category_orderby'],
     246                                'order'        => $parsed_args['category_order'],
    247247                                'hierarchical' => 0,
    248248                        )
    249249                );
    250250                if ( empty( $cats ) ) {
    251                         $r['categorize'] = false;
     251                        $parsed_args['categorize'] = false;
    252252                }
    253253        }
    254254
    255         if ( $r['categorize'] ) {
     255        if ( $parsed_args['categorize'] ) {
    256256                // Split the bookmarks into ul's for each category
    257257                foreach ( (array) $cats as $cat ) {
    258                         $params    = array_merge( $r, array( 'category' => $cat->term_id ) );
     258                        $params    = array_merge( $parsed_args, array( 'category' => $cat->term_id ) );
    259259                        $bookmarks = get_bookmarks( $params );
    260260                        if ( empty( $bookmarks ) ) {
    261261                                continue;
     
    262262                        }
    263263                        $output .= str_replace(
    264264                                array( '%id', '%class' ),
    265                                 array( "linkcat-$cat->term_id", $r['class'] ),
    266                                 $r['category_before']
     265                                array( "linkcat-$cat->term_id", $parsed_args['class'] ),
     266                                $parsed_args['category_before']
    267267                        );
    268268                        /**
    269269                         * Filters the bookmarks category name.
     
    274274                         */
    275275                        $catname = apply_filters( 'link_category', $cat->name );
    276276
    277                         $output .= $r['title_before'];
     277                        $output .= $parsed_args['title_before'];
    278278                        $output .= $catname;
    279                         $output .= $r['title_after'];
     279                        $output .= $parsed_args['title_after'];
    280280                        $output .= "\n\t<ul class='xoxo blogroll'>\n";
    281                         $output .= _walk_bookmarks( $bookmarks, $r );
     281                        $output .= _walk_bookmarks( $bookmarks, $parsed_args );
    282282                        $output .= "\n\t</ul>\n";
    283                         $output .= $r['category_after'] . "\n";
     283                        $output .= $parsed_args['category_after'] . "\n";
    284284                }
    285285        } else {
    286286                //output one single list using title_li for the title
    287                 $bookmarks = get_bookmarks( $r );
     287                $bookmarks = get_bookmarks( $parsed_args );
    288288
    289289                if ( ! empty( $bookmarks ) ) {
    290                         if ( ! empty( $r['title_li'] ) ) {
     290                        if ( ! empty( $parsed_args['title_li'] ) ) {
    291291                                $output .= str_replace(
    292292                                        array( '%id', '%class' ),
    293                                         array( 'linkcat-' . $r['category'], $r['class'] ),
    294                                         $r['category_before']
     293                                        array( 'linkcat-' . $parsed_args['category'], $parsed_args['class'] ),
     294                                        $parsed_args['category_before']
    295295                                );
    296                                 $output .= $r['title_before'];
    297                                 $output .= $r['title_li'];
    298                                 $output .= $r['title_after'];
     296                                $output .= $parsed_args['title_before'];
     297                                $output .= $parsed_args['title_li'];
     298                                $output .= $parsed_args['title_after'];
    299299                                $output .= "\n\t<ul class='xoxo blogroll'>\n";
    300                                 $output .= _walk_bookmarks( $bookmarks, $r );
     300                                $output .= _walk_bookmarks( $bookmarks, $parsed_args );
    301301                                $output .= "\n\t</ul>\n";
    302                                 $output .= $r['category_after'] . "\n";
     302                                $output .= $parsed_args['category_after'] . "\n";
    303303                        } else {
    304                                 $output .= _walk_bookmarks( $bookmarks, $r );
     304                                $output .= _walk_bookmarks( $bookmarks, $parsed_args );
    305305                        }
    306306                }
    307307        }
     
    315315         */
    316316        $html = apply_filters( 'wp_list_bookmarks', $output );
    317317
    318         if ( ! $r['echo'] ) {
     318        if ( ! $parsed_args['echo'] ) {
    319319                return $html;
    320320        }
    321321        echo $html;
  • wp-includes/bookmark.php

     
    136136                'search'         => '',
    137137        );
    138138
    139         $r = wp_parse_args( $args, $defaults );
     139        $parsed_args = wp_parse_args( $args, $defaults );
    140140
    141         $key   = md5( serialize( $r ) );
     141        $key   = md5( serialize( $parsed_args ) );
    142142        $cache = false;
    143         if ( 'rand' !== $r['orderby'] && $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
     143        if ( 'rand' !== $parsed_args['orderby'] && $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
    144144                if ( is_array( $cache ) && isset( $cache[ $key ] ) ) {
    145145                        $bookmarks = $cache[ $key ];
    146146                        /**
     
    156156                         * @see get_bookmarks()
    157157                         *
    158158                         * @param array $bookmarks List of the cached bookmarks.
    159                          * @param array $r         An array of bookmark query arguments.
     159                         * @param array $parsed_args         An array of bookmark query arguments.
    160160                         */
    161                         return apply_filters( 'get_bookmarks', $bookmarks, $r );
     161                        return apply_filters( 'get_bookmarks', $bookmarks, $parsed_args );
    162162                }
    163163        }
    164164
     
    167167        }
    168168
    169169        $inclusions = '';
    170         if ( ! empty( $r['include'] ) ) {
    171                 $r['exclude']       = '';  //ignore exclude, category, and category_name params if using include
    172                 $r['category']      = '';
    173                 $r['category_name'] = '';
    174                 $inclinks           = preg_split( '/[\s,]+/', $r['include'] );
     170        if ( ! empty( $parsed_args['include'] ) ) {
     171                $parsed_args['exclude']       = '';  //ignore exclude, category, and category_name params if using include
     172                $parsed_args['category']      = '';
     173                $parsed_args['category_name'] = '';
     174                $inclinks           = preg_split( '/[\s,]+/', $parsed_args['include'] );
    175175                if ( count( $inclinks ) ) {
    176176                        foreach ( $inclinks as $inclink ) {
    177177                                if ( empty( $inclusions ) ) {
     
    187187        }
    188188
    189189        $exclusions = '';
    190         if ( ! empty( $r['exclude'] ) ) {
    191                 $exlinks = preg_split( '/[\s,]+/', $r['exclude'] );
     190        if ( ! empty( $parsed_args['exclude'] ) ) {
     191                $exlinks = preg_split( '/[\s,]+/', $parsed_args['exclude'] );
    192192                if ( count( $exlinks ) ) {
    193193                        foreach ( $exlinks as $exlink ) {
    194194                                if ( empty( $exclusions ) ) {
     
    203203                $exclusions .= ')';
    204204        }
    205205
    206         if ( ! empty( $r['category_name'] ) ) {
    207                 if ( $r['category'] = get_term_by( 'name', $r['category_name'], 'link_category' ) ) {
    208                         $r['category'] = $r['category']->term_id;
     206        if ( ! empty( $parsed_args['category_name'] ) ) {
     207                if ( $parsed_args['category'] = get_term_by( 'name', $parsed_args['category_name'], 'link_category' ) ) {
     208                        $parsed_args['category'] = $parsed_args['category']->term_id;
    209209                } else {
    210210                        $cache[ $key ] = array();
    211211                        wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
    212212                        /** This filter is documented in wp-includes/bookmark.php */
    213                         return apply_filters( 'get_bookmarks', array(), $r );
     213                        return apply_filters( 'get_bookmarks', array(), $parsed_args );
    214214                }
    215215        }
    216216
    217217        $search = '';
    218         if ( ! empty( $r['search'] ) ) {
    219                 $like   = '%' . $wpdb->esc_like( $r['search'] ) . '%';
     218        if ( ! empty( $parsed_args['search'] ) ) {
     219                $like   = '%' . $wpdb->esc_like( $parsed_args['search'] ) . '%';
    220220                $search = $wpdb->prepare( ' AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ', $like, $like, $like );
    221221        }
    222222
    223223        $category_query = '';
    224224        $join           = '';
    225         if ( ! empty( $r['category'] ) ) {
    226                 $incategories = preg_split( '/[\s,]+/', $r['category'] );
     225        if ( ! empty( $parsed_args['category'] ) ) {
     226                $incategories = preg_split( '/[\s,]+/', $parsed_args['category'] );
    227227                if ( count( $incategories ) ) {
    228228                        foreach ( $incategories as $incat ) {
    229229                                if ( empty( $category_query ) ) {
     
    239239                $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";
    240240        }
    241241
    242         if ( $r['show_updated'] ) {
     242        if ( $parsed_args['show_updated'] ) {
    243243                $recently_updated_test = ', IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated ';
    244244        } else {
    245245                $recently_updated_test = '';
    246246        }
    247247
    248         $get_updated = ( $r['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
     248        $get_updated = ( $parsed_args['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
    249249
    250         $orderby = strtolower( $r['orderby'] );
     250        $orderby = strtolower( $parsed_args['orderby'] );
    251251        $length  = '';
    252252        switch ( $orderby ) {
    253253                case 'length':
     
    278278                $orderby = 'link_name';
    279279        }
    280280
    281         $order = strtoupper( $r['order'] );
     281        $order = strtoupper( $parsed_args['order'] );
    282282        if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ) ) ) {
    283283                $order = 'ASC';
    284284        }
    285285
    286286        $visible = '';
    287         if ( $r['hide_invisible'] ) {
     287        if ( $parsed_args['hide_invisible'] ) {
    288288                $visible = "AND link_visible = 'Y'";
    289289        }
    290290
     
    291291        $query  = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query";
    292292        $query .= " $exclusions $inclusions $search";
    293293        $query .= " ORDER BY $orderby $order";
    294         if ( $r['limit'] != -1 ) {
    295                 $query .= ' LIMIT ' . $r['limit'];
     294        if ( $parsed_args['limit'] != -1 ) {
     295                $query .= ' LIMIT ' . $parsed_args['limit'];
    296296        }
    297297
    298298        $results = $wpdb->get_results( $query );
     
    303303        }
    304304
    305305        /** This filter is documented in wp-includes/bookmark.php */
    306         return apply_filters( 'get_bookmarks', $results, $r );
     306        return apply_filters( 'get_bookmarks', $results, $parsed_args );
    307307}
    308308
    309309/**
  • wp-includes/category-template.php

     
    365365                $args['taxonomy'] = 'link_category';
    366366        }
    367367
    368         $r                 = wp_parse_args( $args, $defaults );
    369         $option_none_value = $r['option_none_value'];
     368        // Parse incoming $args into an array and merge it with $defaults
     369        $parsed_args                 = wp_parse_args( $args, $defaults );
     370        $option_none_value = $args['option_none_value'];
    370371
    371         if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
    372                 $r['pad_counts'] = true;
     372        if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {
     373                $parsed_args['pad_counts'] = true;
    373374        }
    374375
    375         $tab_index = $r['tab_index'];
     376        $tab_index = $parsed_args['tab_index'];
    376377
    377378        $tab_index_attribute = '';
    378379        if ( (int) $tab_index > 0 ) {
     
    380381        }
    381382
    382383        // Avoid clashes with the 'name' param of get_terms().
    383         $get_terms_args = $r;
     384        $get_terms_args = $parsed_args;
    384385        unset( $get_terms_args['name'] );
    385         $categories = get_terms( $r['taxonomy'], $get_terms_args );
     386        $categories = get_terms( $parsed_args['taxonomy'], $get_terms_args );
    386387
    387         $name     = esc_attr( $r['name'] );
    388         $class    = esc_attr( $r['class'] );
    389         $id       = $r['id'] ? esc_attr( $r['id'] ) : $name;
    390         $required = $r['required'] ? 'required' : '';
     388        $name     = esc_attr( $parsed_args['name'] );
     389        $class    = esc_attr( $parsed_args['class'] );
     390        $id       = $parsed_args['id'] ? esc_attr( $parsed_args['id'] ) : $name;
     391        $required = $parsed_args['required'] ? 'required' : '';
    391392
    392         if ( ! $r['hide_if_empty'] || ! empty( $categories ) ) {
     393        if ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) {
    393394                $output = "<select $required name='$name' id='$id' class='$class' $tab_index_attribute>\n";
    394395        } else {
    395396                $output = '';
    396397        }
    397         if ( empty( $categories ) && ! $r['hide_if_empty'] && ! empty( $r['show_option_none'] ) ) {
     398        if ( empty( $categories ) && ! $parsed_args['hide_if_empty'] && ! empty( $parsed_args['show_option_none'] ) ) {
    398399
    399400                /**
    400401                 * Filters a taxonomy drop-down display element.
     
    411412                 * @param string       $element  Category name.
    412413                 * @param WP_Term|null $category The category object, or null if there's no corresponding category.
    413414                 */
    414                 $show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null );
     415                $show_option_none = apply_filters( 'list_cats', $parsed_args['show_option_none'], null );
    415416                $output          .= "\t<option value='" . esc_attr( $option_none_value ) . "' selected='selected'>$show_option_none</option>\n";
    416417        }
    417418
    418419        if ( ! empty( $categories ) ) {
    419420
    420                 if ( $r['show_option_all'] ) {
     421                if ( $parsed_args['show_option_all'] ) {
    421422
    422423                        /** This filter is documented in wp-includes/category-template.php */
    423                         $show_option_all = apply_filters( 'list_cats', $r['show_option_all'], null );
    424                         $selected        = ( '0' === strval( $r['selected'] ) ) ? " selected='selected'" : '';
     424                        $show_option_all = apply_filters( 'list_cats', $parsed_args['show_option_all'], null );
     425                        $selected        = ( '0' === strval( $parsed_args['selected'] ) ) ? " selected='selected'" : '';
    425426                        $output         .= "\t<option value='0'$selected>$show_option_all</option>\n";
    426427                }
    427428
    428                 if ( $r['show_option_none'] ) {
     429                if ( $parsed_args['show_option_none'] ) {
    429430
    430431                        /** This filter is documented in wp-includes/category-template.php */
    431                         $show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null );
    432                         $selected         = selected( $option_none_value, $r['selected'], false );
     432                        $show_option_none = apply_filters( 'list_cats', $parsed_args['show_option_none'], null );
     433                        $selected         = selected( $option_none_value, $parsed_args['selected'], false );
    433434                        $output          .= "\t<option value='" . esc_attr( $option_none_value ) . "'$selected>$show_option_none</option>\n";
    434435                }
    435436
    436                 if ( $r['hierarchical'] ) {
    437                         $depth = $r['depth'];  // Walk the full depth.
     437                if ( $parsed_args['hierarchical'] ) {
     438                        $depth = $parsed_args['depth'];  // Walk the full depth.
    438439                } else {
    439440                        $depth = -1; // Flat.
    440441                }
    441                 $output .= walk_category_dropdown_tree( $categories, $depth, $r );
     442                $output .= walk_category_dropdown_tree( $categories, $depth, $parsed_args );
    442443        }
    443444
    444         if ( ! $r['hide_if_empty'] || ! empty( $categories ) ) {
     445        if ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) {
    445446                $output .= "</select>\n";
    446447        }
    447448        /**
     
    450451         * @since 2.1.0
    451452         *
    452453         * @param string $output HTML output.
    453          * @param array  $r      Arguments used to build the drop-down.
     454         * @param array  $parsed_args      Arguments used to build the drop-down.
    454455         */
    455         $output = apply_filters( 'wp_dropdown_cats', $output, $r );
     456        $output = apply_filters( 'wp_dropdown_cats', $output, $parsed_args );
    456457
    457         if ( $r['echo'] ) {
     458        if ( $parsed_args['echo'] ) {
    458459                echo $output;
    459460        }
    460461        return $output;
     
    537538                'use_desc_for_title'  => 1,
    538539        );
    539540
    540         $r = wp_parse_args( $args, $defaults );
     541        $parsed_args = wp_parse_args( $args, $defaults );
    541542
    542         if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
    543                 $r['pad_counts'] = true;
     543        if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {
     544                $parsed_args['pad_counts'] = true;
    544545        }
    545546
    546547        // Descendants of exclusions should be excluded too.
    547         if ( true == $r['hierarchical'] ) {
     548        if ( true == $parsed_args['hierarchical'] ) {
    548549                $exclude_tree = array();
    549550
    550                 if ( $r['exclude_tree'] ) {
    551                         $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude_tree'] ) );
     551                if ( $parsed_args['exclude_tree'] ) {
     552                        $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude_tree'] ) );
    552553                }
    553554
    554                 if ( $r['exclude'] ) {
    555                         $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude'] ) );
     555                if ( $parsed_args['exclude'] ) {
     556                        $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude'] ) );
    556557                }
    557558
    558                 $r['exclude_tree'] = $exclude_tree;
    559                 $r['exclude']      = '';
     559                $parsed_args['exclude_tree'] = $exclude_tree;
     560                $parsed_args['exclude']      = '';
    560561        }
    561562
    562         if ( ! isset( $r['class'] ) ) {
    563                 $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy'];
     563        if ( ! isset( $parsed_args['class'] ) ) {
     564                $parsed_args['class'] = ( 'category' == $parsed_args['taxonomy'] ) ? 'categories' : $parsed_args['taxonomy'];
    564565        }
    565566
    566         if ( ! taxonomy_exists( $r['taxonomy'] ) ) {
     567        if ( ! taxonomy_exists( $parsed_args['taxonomy'] ) ) {
    567568                return false;
    568569        }
    569570
    570         $show_option_all  = $r['show_option_all'];
    571         $show_option_none = $r['show_option_none'];
     571        $show_option_all  = $parsed_args['show_option_all'];
     572        $show_option_none = $parsed_args['show_option_none'];
    572573
    573         $categories = get_categories( $r );
     574        $categories = get_categories( $parsed_args );
    574575
    575576        $output = '';
    576         if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) {
    577                 $output = '<li class="' . esc_attr( $r['class'] ) . '">' . $r['title_li'] . '<ul>';
     577        if ( $parsed_args['title_li'] && 'list' == $parsed_args['style'] && ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] ) ) {
     578                $output = '<li class="' . esc_attr( $parsed_args['class'] ) . '">' . $parsed_args['title_li'] . '<ul>';
    578579        }
    579580        if ( empty( $categories ) ) {
    580581                if ( ! empty( $show_option_none ) ) {
    581                         if ( 'list' == $r['style'] ) {
     582                        if ( 'list' == $parsed_args['style'] ) {
    582583                                $output .= '<li class="cat-item-none">' . $show_option_none . '</li>';
    583584                        } else {
    584585                                $output .= $show_option_none;
     
    590591                        $posts_page = '';
    591592
    592593                        // For taxonomies that belong only to custom post types, point to a valid archive.
    593                         $taxonomy_object = get_taxonomy( $r['taxonomy'] );
     594                        $taxonomy_object = get_taxonomy( $parsed_args['taxonomy'] );
    594595                        if ( ! in_array( 'post', $taxonomy_object->object_type ) && ! in_array( 'page', $taxonomy_object->object_type ) ) {
    595596                                foreach ( $taxonomy_object->object_type as $object_type ) {
    596597                                        $_object_type = get_post_type_object( $object_type );
     
    613614                        }
    614615
    615616                        $posts_page = esc_url( $posts_page );
    616                         if ( 'list' == $r['style'] ) {
     617                        if ( 'list' == $parsed_args['style'] ) {
    617618                                $output .= "<li class='cat-item-all'><a href='$posts_page'>$show_option_all</a></li>";
    618619                        } else {
    619620                                $output .= "<a href='$posts_page'>$show_option_all</a>";
     
    620621                        }
    621622                }
    622623
    623                 if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
     624                if ( empty( $parsed_args['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
    624625                        $current_term_object = get_queried_object();
    625                         if ( $current_term_object && $r['taxonomy'] === $current_term_object->taxonomy ) {
    626                                 $r['current_category'] = get_queried_object_id();
     626                        if ( $current_term_object && $parsed_args['taxonomy'] === $current_term_object->taxonomy ) {
     627                                $parsed_args['current_category'] = get_queried_object_id();
    627628                        }
    628629                }
    629630
    630                 if ( $r['hierarchical'] ) {
    631                         $depth = $r['depth'];
     631                if ( $parsed_args['hierarchical'] ) {
     632                        $depth = $parsed_args['depth'];
    632633                } else {
    633634                        $depth = -1; // Flat.
    634635                }
    635                 $output .= walk_category_tree( $categories, $depth, $r );
     636                $output .= walk_category_tree( $categories, $depth, $parsed_args );
    636637        }
    637638
    638         if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) {
     639        if ( $parsed_args['title_li'] && 'list' == $parsed_args['style'] && ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] ) ) {
    639640                $output .= '</ul></li>';
    640641        }
    641642
     
    649650         */
    650651        $html = apply_filters( 'wp_list_categories', $output, $args );
    651652
    652         if ( $r['echo'] ) {
     653        if ( $parsed_args['echo'] ) {
    653654                echo $html;
    654655        } else {
    655656                return $html;
  • wp-includes/class-http.php

     
    220220                        $defaults['redirection'] = 0;
    221221                }
    222222
    223                 $r = wp_parse_args( $args, $defaults );
     223                $parsed_args = wp_parse_args( $args, $defaults );
    224224                /**
    225225                 * Filters the arguments used in an HTTP request.
    226226                 *
    227227                 * @since 2.7.0
    228228                 *
    229                  * @param array  $r   An array of HTTP request arguments.
     229                 * @param array  $parsed_args   An array of HTTP request arguments.
    230230                 * @param string $url The request URL.
    231231                 */
    232                 $r = apply_filters( 'http_request_args', $r, $url );
     232                $parsed_args = apply_filters( 'http_request_args', $parsed_args, $url );
    233233
    234234                // The transports decrement this, store a copy of the original value for loop purposes.
    235                 if ( ! isset( $r['_redirection'] ) ) {
    236                         $r['_redirection'] = $r['redirection'];
     235                if ( ! isset( $parsed_args['_redirection'] ) ) {
     236                        $parsed_args['_redirection'] = $parsed_args['redirection'];
    237237                }
    238238
    239239                /**
     
    251251                 * @since 2.9.0
    252252                 *
    253253                 * @param false|array|WP_Error $preempt Whether to preempt an HTTP request's return value. Default false.
    254                  * @param array               $r        HTTP request arguments.
     254                 * @param array               $parsed_args        HTTP request arguments.
    255255                 * @param string              $url      The request URL.
    256256                 */
    257                 $pre = apply_filters( 'pre_http_request', false, $r, $url );
     257                $pre = apply_filters( 'pre_http_request', false, $parsed_args, $url );
    258258
    259259                if ( false !== $pre ) {
    260260                        return $pre;
     
    261261                }
    262262
    263263                if ( function_exists( 'wp_kses_bad_protocol' ) ) {
    264                         if ( $r['reject_unsafe_urls'] ) {
     264                        if ( $parsed_args['reject_unsafe_urls'] ) {
    265265                                $url = wp_http_validate_url( $url );
    266266                        }
    267267                        if ( $url ) {
     
    281281
    282282                // If we are streaming to a file but no filename was given drop it in the WP temp dir
    283283                // and pick its name using the basename of the $url
    284                 if ( $r['stream'] ) {
    285                         if ( empty( $r['filename'] ) ) {
    286                                 $r['filename'] = get_temp_dir() . basename( $url );
     284                if ( $parsed_args['stream'] ) {
     285                        if ( empty( $parsed_args['filename'] ) ) {
     286                                $parsed_args['filename'] = get_temp_dir() . basename( $url );
    287287                        }
    288288
    289289                        // Force some settings if we are streaming to a file and check for existence and perms of destination directory
    290                         $r['blocking'] = true;
    291                         if ( ! wp_is_writable( dirname( $r['filename'] ) ) ) {
     290                        $parsed_args['blocking'] = true;
     291                        if ( ! wp_is_writable( dirname( $parsed_args['filename'] ) ) ) {
    292292                                return new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) );
    293293                        }
    294294                }
    295295
    296                 if ( is_null( $r['headers'] ) ) {
    297                         $r['headers'] = array();
     296                if ( is_null( $parsed_args['headers'] ) ) {
     297                        $parsed_args['headers'] = array();
    298298                }
    299299
    300300                // WP allows passing in headers as a string, weirdly.
    301                 if ( ! is_array( $r['headers'] ) ) {
    302                         $processedHeaders = WP_Http::processHeaders( $r['headers'] );
    303                         $r['headers']     = $processedHeaders['headers'];
     301                if ( ! is_array( $parsed_args['headers'] ) ) {
     302                        $processedHeaders = WP_Http::processHeaders( $parsed_args['headers'] );
     303                        $parsed_args['headers']     = $processedHeaders['headers'];
    304304                }
    305305
    306306                // Setup arguments
    307                 $headers = $r['headers'];
    308                 $data    = $r['body'];
    309                 $type    = $r['method'];
     307                $headers = $parsed_args['headers'];
     308                $data    = $parsed_args['body'];
     309                $type    = $parsed_args['method'];
    310310                $options = array(
    311                         'timeout'   => $r['timeout'],
    312                         'useragent' => $r['user-agent'],
    313                         'blocking'  => $r['blocking'],
    314                         'hooks'     => new WP_HTTP_Requests_Hooks( $url, $r ),
     311                        'timeout'   => $parsed_args['timeout'],
     312                        'useragent' => $parsed_args['user-agent'],
     313                        'blocking'  => $parsed_args['blocking'],
     314                        'hooks'     => new WP_HTTP_Requests_Hooks( $url, $parsed_args ),
    315315                );
    316316
    317317                // Ensure redirects follow browser behaviour.
     
    318318                $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) );
    319319
    320320                // Validate redirected URLs.
    321                 if ( function_exists( 'wp_kses_bad_protocol' ) && $r['reject_unsafe_urls'] ) {
     321                if ( function_exists( 'wp_kses_bad_protocol' ) && $parsed_args['reject_unsafe_urls'] ) {
    322322                        $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'validate_redirects' ) );
    323323                }
    324324
    325                 if ( $r['stream'] ) {
    326                         $options['filename'] = $r['filename'];
     325                if ( $parsed_args['stream'] ) {
     326                        $options['filename'] = $parsed_args['filename'];
    327327                }
    328                 if ( empty( $r['redirection'] ) ) {
     328                if ( empty( $parsed_args['redirection'] ) ) {
    329329                        $options['follow_redirects'] = false;
    330330                } else {
    331                         $options['redirects'] = $r['redirection'];
     331                        $options['redirects'] = $parsed_args['redirection'];
    332332                }
    333333
    334334                // Use byte limit, if we can
    335                 if ( isset( $r['limit_response_size'] ) ) {
    336                         $options['max_bytes'] = $r['limit_response_size'];
     335                if ( isset( $parsed_args['limit_response_size'] ) ) {
     336                        $options['max_bytes'] = $parsed_args['limit_response_size'];
    337337                }
    338338
    339339                // If we've got cookies, use and convert them to Requests_Cookie.
    340                 if ( ! empty( $r['cookies'] ) ) {
    341                         $options['cookies'] = WP_Http::normalize_cookies( $r['cookies'] );
     340                if ( ! empty( $parsed_args['cookies'] ) ) {
     341                        $options['cookies'] = WP_Http::normalize_cookies( $parsed_args['cookies'] );
    342342                }
    343343
    344344                // SSL certificate handling
    345                 if ( ! $r['sslverify'] ) {
     345                if ( ! $parsed_args['sslverify'] ) {
    346346                        $options['verify']     = false;
    347347                        $options['verifyname'] = false;
    348348                } else {
    349                         $options['verify'] = $r['sslcertificates'];
     349                        $options['verify'] = $parsed_args['sslcertificates'];
    350350                }
    351351
    352352                // All non-GET/HEAD requests should put the arguments in the form body.
     
    384384                        $requests_response = Requests::request( $url, $headers, $data, $type, $options );
    385385
    386386                        // Convert the response into an array
    387                         $http_response = new WP_HTTP_Requests_Response( $requests_response, $r['filename'] );
     387                        $http_response = new WP_HTTP_Requests_Response( $requests_response, $parsed_args['filename'] );
    388388                        $response      = $http_response->to_array();
    389389
    390390                        // Add the original object to the array.
     
    403403                 * @param array|WP_Error $response HTTP response or WP_Error object.
    404404                 * @param string         $context  Context under which the hook is fired.
    405405                 * @param string         $class    HTTP transport used.
    406                  * @param array          $r        HTTP request arguments.
     406                 * @param array          $parsed_args        HTTP request arguments.
    407407                 * @param string         $url      The request URL.
    408408                 */
    409                 do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
     409                do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
    410410                if ( is_wp_error( $response ) ) {
    411411                        return $response;
    412412                }
    413413
    414                 if ( ! $r['blocking'] ) {
     414                if ( ! $parsed_args['blocking'] ) {
    415415                        return array(
    416416                                'headers'       => array(),
    417417                                'body'          => '',
     
    430430                 * @since 2.9.0
    431431                 *
    432432                 * @param array  $response HTTP response.
    433                  * @param array  $r        HTTP request arguments.
     433                 * @param array  $parsed_args        HTTP request arguments.
    434434                 * @param string $url      The request URL.
    435435                 */
    436                 return apply_filters( 'http_response', $response, $r, $url );
     436                return apply_filters( 'http_response', $response, $parsed_args, $url );
    437437        }
    438438
    439439        /**
     
    592592         */
    593593        public function post( $url, $args = array() ) {
    594594                $defaults = array( 'method' => 'POST' );
    595                 $r        = wp_parse_args( $args, $defaults );
    596                 return $this->request( $url, $r );
     595                $parsed_args        = wp_parse_args( $args, $defaults );
     596                return $this->request( $url, $parsed_args );
    597597        }
    598598
    599599        /**
     
    609609         */
    610610        public function get( $url, $args = array() ) {
    611611                $defaults = array( 'method' => 'GET' );
    612                 $r        = wp_parse_args( $args, $defaults );
    613                 return $this->request( $url, $r );
     612                $parsed_args        = wp_parse_args( $args, $defaults );
     613                return $this->request( $url, $parsed_args );
    614614        }
    615615
    616616        /**
     
    626626         */
    627627        public function head( $url, $args = array() ) {
    628628                $defaults = array( 'method' => 'HEAD' );
    629                 $r        = wp_parse_args( $args, $defaults );
    630                 return $this->request( $url, $r );
     629                $parsed_args        = wp_parse_args( $args, $defaults );
     630                return $this->request( $url, $parsed_args );
    631631        }
    632632
    633633        /**
  • wp-includes/class-wp-ajax-response.php

     
    7373                        'supplemental' => array(),
    7474                );
    7575
    76                 $r = wp_parse_args( $args, $defaults );
     76                $parsed_args = wp_parse_args( $args, $defaults );
    7777
    78                 $position = preg_replace( '/[^a-z0-9:_-]/i', '', $r['position'] );
    79                 $id       = $r['id'];
    80                 $what     = $r['what'];
    81                 $action   = $r['action'];
    82                 $old_id   = $r['old_id'];
    83                 $data     = $r['data'];
     78                $position = preg_replace( '/[^a-z0-9:_-]/i', '', $parsed_args['position'] );
     79                $id       = $parsed_args['id'];
     80                $what     = $parsed_args['what'];
     81                $action   = $parsed_args['action'];
     82                $old_id   = $parsed_args['old_id'];
     83                $data     = $parsed_args['data'];
    8484
    8585                if ( is_wp_error( $id ) ) {
    8686                        $data = $id;
     
    117117                }
    118118
    119119                $s = '';
    120                 if ( is_array( $r['supplemental'] ) ) {
    121                         foreach ( $r['supplemental'] as $k => $v ) {
     120                if ( is_array( $parsed_args['supplemental'] ) ) {
     121                        foreach ( $parsed_args['supplemental'] as $k => $v ) {
    122122                                $s .= "<$k><![CDATA[$v]]></$k>";
    123123                        }
    124124                        $s = "<supplemental>$s</supplemental>";
  • wp-includes/class-wp-http-curl.php

     
    7979                        'cookies'     => array(),
    8080                );
    8181
    82                 $r = wp_parse_args( $args, $defaults );
     82                $parsed_args = wp_parse_args( $args, $defaults );
    8383
    84                 if ( isset( $r['headers']['User-Agent'] ) ) {
    85                         $r['user-agent'] = $r['headers']['User-Agent'];
    86                         unset( $r['headers']['User-Agent'] );
    87                 } elseif ( isset( $r['headers']['user-agent'] ) ) {
    88                         $r['user-agent'] = $r['headers']['user-agent'];
    89                         unset( $r['headers']['user-agent'] );
     84                if ( isset( $parsed_args['headers']['User-Agent'] ) ) {
     85                        $parsed_args['user-agent'] = $parsed_args['headers']['User-Agent'];
     86                        unset( $parsed_args['headers']['User-Agent'] );
     87                } elseif ( isset( $parsed_args['headers']['user-agent'] ) ) {
     88                        $parsed_args['user-agent'] = $parsed_args['headers']['user-agent'];
     89                        unset( $parsed_args['headers']['user-agent'] );
    9090                }
    9191
    9292                // Construct Cookie: header if any cookies are set.
    93                 WP_Http::buildCookieHeader( $r );
     93                WP_Http::buildCookieHeader( $parsed_args );
    9494
    9595                $handle = curl_init();
    9696
     
    109109                        }
    110110                }
    111111
    112                 $is_local   = isset( $r['local'] ) && $r['local'];
    113                 $ssl_verify = isset( $r['sslverify'] ) && $r['sslverify'];
     112                $is_local   = isset( $parsed_args['local'] ) && $parsed_args['local'];
     113                $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];
    114114                if ( $is_local ) {
    115115                        /** This filter is documented in wp-includes/class-wp-http-streams.php */
    116116                        $ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify, $url );
     
    123123                 * CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since.
    124124                 * a value of 0 will allow an unlimited timeout.
    125125                 */
    126                 $timeout = (int) ceil( $r['timeout'] );
     126                $timeout = (int) ceil( $parsed_args['timeout'] );
    127127                curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
    128128                curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
    129129
     
    133133                curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );
    134134
    135135                if ( $ssl_verify ) {
    136                         curl_setopt( $handle, CURLOPT_CAINFO, $r['sslcertificates'] );
     136                        curl_setopt( $handle, CURLOPT_CAINFO, $parsed_args['sslcertificates'] );
    137137                }
    138138
    139                 curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
     139                curl_setopt( $handle, CURLOPT_USERAGENT, $parsed_args['user-agent'] );
    140140
    141141                /*
    142142                 * The option doesn't work with safe mode or when open_basedir is set, and there's
     
    147147                        curl_setopt( $handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
    148148                }
    149149
    150                 switch ( $r['method'] ) {
     150                switch ( $parsed_args['method'] ) {
    151151                        case 'HEAD':
    152152                                curl_setopt( $handle, CURLOPT_NOBODY, true );
    153153                                break;
    154154                        case 'POST':
    155155                                curl_setopt( $handle, CURLOPT_POST, true );
    156                                 curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
     156                                curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
    157157                                break;
    158158                        case 'PUT':
    159159                                curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' );
    160                                 curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
     160                                curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
    161161                                break;
    162162                        default:
    163                                 curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $r['method'] );
    164                                 if ( ! is_null( $r['body'] ) ) {
    165                                         curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
     163                                curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $parsed_args['method'] );
     164                                if ( ! is_null( $parsed_args['body'] ) ) {
     165                                        curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
    166166                                }
    167167                                break;
    168168                }
    169169
    170                 if ( true === $r['blocking'] ) {
     170                if ( true === $parsed_args['blocking'] ) {
    171171                        curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) );
    172172                        curl_setopt( $handle, CURLOPT_WRITEFUNCTION, array( $this, 'stream_body' ) );
    173173                }
     
    174174
    175175                curl_setopt( $handle, CURLOPT_HEADER, false );
    176176
    177                 if ( isset( $r['limit_response_size'] ) ) {
    178                         $this->max_body_length = intval( $r['limit_response_size'] );
     177                if ( isset( $parsed_args['limit_response_size'] ) ) {
     178                        $this->max_body_length = intval( $parsed_args['limit_response_size'] );
    179179                } else {
    180180                        $this->max_body_length = false;
    181181                }
    182182
    183183                // If streaming to a file open a file handle, and setup our curl streaming handler.
    184                 if ( $r['stream'] ) {
     184                if ( $parsed_args['stream'] ) {
    185185                        if ( ! WP_DEBUG ) {
    186                                 $this->stream_handle = @fopen( $r['filename'], 'w+' );
     186                                $this->stream_handle = @fopen( $parsed_args['filename'], 'w+' );
    187187                        } else {
    188                                 $this->stream_handle = fopen( $r['filename'], 'w+' );
     188                                $this->stream_handle = fopen( $parsed_args['filename'], 'w+' );
    189189                        }
    190190                        if ( ! $this->stream_handle ) {
    191191                                return new WP_Error(
     
    194194                                                /* translators: 1: fopen(), 2: file name */
    195195                                                __( 'Could not open handle for %1$s to %2$s.' ),
    196196                                                'fopen()',
    197                                                 $r['filename']
     197                                                $parsed_args['filename']
    198198                                        )
    199199                                );
    200200                        }
     
    202202                        $this->stream_handle = false;
    203203                }
    204204
    205                 if ( ! empty( $r['headers'] ) ) {
     205                if ( ! empty( $parsed_args['headers'] ) ) {
    206206                        // cURL expects full header strings in each element.
    207207                        $headers = array();
    208                         foreach ( $r['headers'] as $name => $value ) {
     208                        foreach ( $parsed_args['headers'] as $name => $value ) {
    209209                                $headers[] = "{$name}: $value";
    210210                        }
    211211                        curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );
    212212                }
    213213
    214                 if ( $r['httpversion'] == '1.0' ) {
     214                if ( $parsed_args['httpversion'] == '1.0' ) {
    215215                        curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );
    216216                } else {
    217217                        curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
     
    226226                 * @since 2.8.0
    227227                 *
    228228                 * @param resource $handle  The cURL handle returned by curl_init() (passed by reference).
    229                  * @param array    $r       The HTTP request arguments.
     229                 * @param array    $parsed_args       The HTTP request arguments.
    230230                 * @param string   $url     The request URL.
    231231                 */
    232                 do_action_ref_array( 'http_api_curl', array( &$handle, $r, $url ) );
     232                do_action_ref_array( 'http_api_curl', array( &$handle, $parsed_args, $url ) );
    233233
    234234                // We don't need to return the body, so don't. Just execute request and return.
    235                 if ( ! $r['blocking'] ) {
     235                if ( ! $parsed_args['blocking'] ) {
    236236                        curl_exec( $handle );
    237237
    238238                        if ( $curl_error = curl_error( $handle ) ) {
     
    271271                if ( $curl_error || ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) ) {
    272272                        if ( CURLE_WRITE_ERROR /* 23 */ == $curl_error ) {
    273273                                if ( ! $this->max_body_length || $this->max_body_length != $bytes_written_total ) {
    274                                         if ( $r['stream'] ) {
     274                                        if ( $parsed_args['stream'] ) {
    275275                                                curl_close( $handle );
    276276                                                fclose( $this->stream_handle );
    277277                                                return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );
     
    294294
    295295                curl_close( $handle );
    296296
    297                 if ( $r['stream'] ) {
     297                if ( $parsed_args['stream'] ) {
    298298                        fclose( $this->stream_handle );
    299299                }
    300300
     
    303303                        'body'     => null,
    304304                        'response' => $theHeaders['response'],
    305305                        'cookies'  => $theHeaders['cookies'],
    306                         'filename' => $r['filename'],
     306                        'filename' => $parsed_args['filename'],
    307307                );
    308308
    309309                // Handle redirects.
    310                 if ( false !== ( $redirect_response = WP_HTTP::handle_redirects( $url, $r, $response ) ) ) {
     310                if ( false !== ( $redirect_response = WP_HTTP::handle_redirects( $url, $parsed_args, $response ) ) ) {
    311311                        return $redirect_response;
    312312                }
    313313
    314                 if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {
     314                if ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {
    315315                        $theBody = WP_Http_Encoding::decompress( $theBody );
    316316                }
    317317
  • wp-includes/class-wp-http-streams.php

     
    3838                        'cookies'     => array(),
    3939                );
    4040
    41                 $r = wp_parse_args( $args, $defaults );
     41                $parsed_args = wp_parse_args( $args, $defaults );
    4242
    43                 if ( isset( $r['headers']['User-Agent'] ) ) {
    44                         $r['user-agent'] = $r['headers']['User-Agent'];
    45                         unset( $r['headers']['User-Agent'] );
    46                 } elseif ( isset( $r['headers']['user-agent'] ) ) {
    47                         $r['user-agent'] = $r['headers']['user-agent'];
    48                         unset( $r['headers']['user-agent'] );
     43                if ( isset( $parsed_args['headers']['User-Agent'] ) ) {
     44                        $parsed_args['user-agent'] = $parsed_args['headers']['User-Agent'];
     45                        unset( $parsed_args['headers']['User-Agent'] );
     46                } elseif ( isset( $parsed_args['headers']['user-agent'] ) ) {
     47                        $parsed_args['user-agent'] = $parsed_args['headers']['user-agent'];
     48                        unset( $parsed_args['headers']['user-agent'] );
    4949                }
    5050
    5151                // Construct Cookie: header if any cookies are set.
    52                 WP_Http::buildCookieHeader( $r );
     52                WP_Http::buildCookieHeader( $parsed_args );
    5353
    5454                $arrURL = parse_url( $url );
    5555
     
    7070                        $arrURL['path'] = '/';
    7171                }
    7272
    73                 if ( isset( $r['headers']['Host'] ) || isset( $r['headers']['host'] ) ) {
    74                         if ( isset( $r['headers']['Host'] ) ) {
    75                                 $arrURL['host'] = $r['headers']['Host'];
     73                if ( isset( $parsed_args['headers']['Host'] ) || isset( $parsed_args['headers']['host'] ) ) {
     74                        if ( isset( $parsed_args['headers']['Host'] ) ) {
     75                                $arrURL['host'] = $parsed_args['headers']['Host'];
    7676                        } else {
    77                                 $arrURL['host'] = $r['headers']['host'];
     77                                $arrURL['host'] = $parsed_args['headers']['host'];
    7878                        }
    79                         unset( $r['headers']['Host'], $r['headers']['host'] );
     79                        unset( $parsed_args['headers']['Host'], $parsed_args['headers']['host'] );
    8080                }
    8181
    8282                /*
     
    9090
    9191                $connect_host = $secure_transport ? 'ssl://' . $connect_host : 'tcp://' . $connect_host;
    9292
    93                 $is_local   = isset( $r['local'] ) && $r['local'];
    94                 $ssl_verify = isset( $r['sslverify'] ) && $r['sslverify'];
     93                $is_local   = isset( $parsed_args['local'] ) && $parsed_args['local'];
     94                $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];
    9595                if ( $is_local ) {
    9696                        /**
    9797                         * Filters whether SSL should be verified for local requests.
     
    117117                                        //'CN_match' => $arrURL['host'], // This is handled by self::verify_ssl_certificate()
    118118                                        'capture_peer_cert' => $ssl_verify,
    119119                                        'SNI_enabled'       => true,
    120                                         'cafile'            => $r['sslcertificates'],
     120                                        'cafile'            => $parsed_args['sslcertificates'],
    121121                                        'allow_self_signed' => ! $ssl_verify,
    122122                                ),
    123123                        )
    124124                );
    125125
    126                 $timeout         = (int) floor( $r['timeout'] );
    127                 $utimeout        = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000;
     126                $timeout         = (int) floor( $parsed_args['timeout'] );
     127                $utimeout        = $timeout == $parsed_args['timeout'] ? 0 : 1000000 * $parsed_args['timeout'] % 1000000;
    128128                $connect_timeout = max( $timeout, 1 );
    129129
    130130                // Store error number.
     
    180180                        $requestPath = $arrURL['path'] . ( isset( $arrURL['query'] ) ? '?' . $arrURL['query'] : '' );
    181181                }
    182182
    183                 $strHeaders = strtoupper( $r['method'] ) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
     183                $strHeaders = strtoupper( $parsed_args['method'] ) . ' ' . $requestPath . ' HTTP/' . $parsed_args['httpversion'] . "\r\n";
    184184
    185185                $include_port_in_host_header = (
    186186                        ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) ||
     
    194194                        $strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n";
    195195                }
    196196
    197                 if ( isset( $r['user-agent'] ) ) {
    198                         $strHeaders .= 'User-agent: ' . $r['user-agent'] . "\r\n";
     197                if ( isset( $parsed_args['user-agent'] ) ) {
     198                        $strHeaders .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n";
    199199                }
    200200
    201                 if ( is_array( $r['headers'] ) ) {
    202                         foreach ( (array) $r['headers'] as $header => $headerValue ) {
     201                if ( is_array( $parsed_args['headers'] ) ) {
     202                        foreach ( (array) $parsed_args['headers'] as $header => $headerValue ) {
    203203                                $strHeaders .= $header . ': ' . $headerValue . "\r\n";
    204204                        }
    205205                } else {
    206                         $strHeaders .= $r['headers'];
     206                        $strHeaders .= $parsed_args['headers'];
    207207                }
    208208
    209209                if ( $proxy->use_authentication() ) {
     
    212212
    213213                $strHeaders .= "\r\n";
    214214
    215                 if ( ! is_null( $r['body'] ) ) {
    216                         $strHeaders .= $r['body'];
     215                if ( ! is_null( $parsed_args['body'] ) ) {
     216                        $strHeaders .= $parsed_args['body'];
    217217                }
    218218
    219219                fwrite( $handle, $strHeaders );
    220220
    221                 if ( ! $r['blocking'] ) {
     221                if ( ! $parsed_args['blocking'] ) {
    222222                        stream_set_blocking( $handle, 0 );
    223223                        fclose( $handle );
    224224                        return array(
     
    236236                $bodyStarted  = false;
    237237                $keep_reading = true;
    238238                $block_size   = 4096;
    239                 if ( isset( $r['limit_response_size'] ) ) {
    240                         $block_size = min( $block_size, $r['limit_response_size'] );
     239                if ( isset( $parsed_args['limit_response_size'] ) ) {
     240                        $block_size = min( $block_size, $parsed_args['limit_response_size'] );
    241241                }
    242242
    243243                // If streaming to a file setup the file handle.
    244                 if ( $r['stream'] ) {
     244                if ( $parsed_args['stream'] ) {
    245245                        if ( ! WP_DEBUG ) {
    246                                 $stream_handle = @fopen( $r['filename'], 'w+' );
     246                                $stream_handle = @fopen( $parsed_args['filename'], 'w+' );
    247247                        } else {
    248                                 $stream_handle = fopen( $r['filename'], 'w+' );
     248                                $stream_handle = fopen( $parsed_args['filename'], 'w+' );
    249249                        }
    250250                        if ( ! $stream_handle ) {
    251251                                return new WP_Error(
     
    254254                                                /* translators: 1: fopen(), 2: file name */
    255255                                                __( 'Could not open handle for %1$s to %2$s.' ),
    256256                                                'fopen()',
    257                                                 $r['filename']
     257                                                $parsed_args['filename']
    258258                                        )
    259259                                );
    260260                        }
     
    275275
    276276                                $this_block_size = strlen( $block );
    277277
    278                                 if ( isset( $r['limit_response_size'] ) && ( $bytes_written + $this_block_size ) > $r['limit_response_size'] ) {
    279                                         $this_block_size = ( $r['limit_response_size'] - $bytes_written );
     278                                if ( isset( $parsed_args['limit_response_size'] ) && ( $bytes_written + $this_block_size ) > $parsed_args['limit_response_size'] ) {
     279                                        $this_block_size = ( $parsed_args['limit_response_size'] - $bytes_written );
    280280                                        $block           = substr( $block, 0, $this_block_size );
    281281                                }
    282282
     
    290290
    291291                                $bytes_written += $bytes_written_to_file;
    292292
    293                                 $keep_reading = ! isset( $r['limit_response_size'] ) || $bytes_written < $r['limit_response_size'];
     293                                $keep_reading = ! isset( $parsed_args['limit_response_size'] ) || $bytes_written < $parsed_args['limit_response_size'];
    294294                        }
    295295
    296296                        fclose( $stream_handle );
     
    304304                                        $header_length = strpos( $strResponse, "\r\n\r\n" ) + 4;
    305305                                        $bodyStarted   = true;
    306306                                }
    307                                 $keep_reading = ( ! $bodyStarted || ! isset( $r['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $r['limit_response_size'] ) );
     307                                $keep_reading = ( ! $bodyStarted || ! isset( $parsed_args['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $parsed_args['limit_response_size'] ) );
    308308                        }
    309309
    310310                        $process = WP_Http::processResponse( $strResponse );
     
    322322                        'body'     => null,
    323323                        'response' => $arrHeaders['response'],
    324324                        'cookies'  => $arrHeaders['cookies'],
    325                         'filename' => $r['filename'],
     325                        'filename' => $parsed_args['filename'],
    326326                );
    327327
    328328                // Handle redirects.
    329                 if ( false !== ( $redirect_response = WP_Http::handle_redirects( $url, $r, $response ) ) ) {
     329                if ( false !== ( $redirect_response = WP_Http::handle_redirects( $url, $parsed_args, $response ) ) ) {
    330330                        return $redirect_response;
    331331                }
    332332
     
    335335                        $process['body'] = WP_Http::chunkTransferDecode( $process['body'] );
    336336                }
    337337
    338                 if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode( $arrHeaders['headers'] ) ) {
     338                if ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $arrHeaders['headers'] ) ) {
    339339                        $process['body'] = WP_Http_Encoding::decompress( $process['body'] );
    340340                }
    341341
    342                 if ( isset( $r['limit_response_size'] ) && strlen( $process['body'] ) > $r['limit_response_size'] ) {
    343                         $process['body'] = substr( $process['body'], 0, $r['limit_response_size'] );
     342                if ( isset( $parsed_args['limit_response_size'] ) && strlen( $process['body'] ) > $parsed_args['limit_response_size'] ) {
     343                        $process['body'] = substr( $process['body'], 0, $parsed_args['limit_response_size'] );
    344344                }
    345345
    346346                $response['body'] = $process['body'];
  • wp-includes/comment-template.php

     
    20072007                'echo'              => true,
    20082008        );
    20092009
    2010         $r = wp_parse_args( $args, $defaults );
     2010        $parsed_args = wp_parse_args( $args, $defaults );
    20112011
    20122012        /**
    20132013         * Filters the arguments used in retrieving the comment list.
     
    20162016         *
    20172017         * @see wp_list_comments()
    20182018         *
    2019          * @param array $r An array of arguments for displaying comments.
     2019         * @param array $parsed_args An array of arguments for displaying comments.
    20202020         */
    2021         $r = apply_filters( 'wp_list_comments_args', $r );
     2021        $parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args );
    20222022
    20232023        // Figure out what comments we'll be looping through ($_comments)
    20242024        if ( null !== $comments ) {
     
    20262026                if ( empty( $comments ) ) {
    20272027                        return;
    20282028                }
    2029                 if ( 'all' != $r['type'] ) {
     2029                if ( 'all' != $parsed_args['type'] ) {
    20302030                        $comments_by_type = separate_comments( $comments );
    2031                         if ( empty( $comments_by_type[ $r['type'] ] ) ) {
     2031                        if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {
    20322032                                return;
    20332033                        }
    2034                         $_comments = $comments_by_type[ $r['type'] ];
     2034                        $_comments = $comments_by_type[ $parsed_args['type'] ];
    20352035                } else {
    20362036                        $_comments = $comments;
    20372037                }
     
    20402040                 * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,
    20412041                 * perform a separate comment query and allow Walker_Comment to paginate.
    20422042                 */
    2043                 if ( $r['page'] || $r['per_page'] ) {
     2043                if ( $parsed_args['page'] || $parsed_args['per_page'] ) {
    20442044                        $current_cpage = get_query_var( 'cpage' );
    20452045                        if ( ! $current_cpage ) {
    20462046                                $current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;
     
    20472047                        }
    20482048
    20492049                        $current_per_page = get_query_var( 'comments_per_page' );
    2050                         if ( $r['page'] != $current_cpage || $r['per_page'] != $current_per_page ) {
     2050                        if ( $parsed_args['page'] != $current_cpage || $parsed_args['per_page'] != $current_per_page ) {
    20512051                                $comment_args = array(
    20522052                                        'post_id' => get_the_ID(),
    20532053                                        'orderby' => 'comment_date_gmt',
     
    20662066
    20672067                                $comments = get_comments( $comment_args );
    20682068
    2069                                 if ( 'all' != $r['type'] ) {
     2069                                if ( 'all' != $parsed_args['type'] ) {
    20702070                                        $comments_by_type = separate_comments( $comments );
    2071                                         if ( empty( $comments_by_type[ $r['type'] ] ) ) {
     2071                                        if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {
    20722072                                                return;
    20732073                                        }
    20742074
    2075                                         $_comments = $comments_by_type[ $r['type'] ];
     2075                                        $_comments = $comments_by_type[ $parsed_args['type'] ];
    20762076                                } else {
    20772077                                        $_comments = $comments;
    20782078                                }
     
    20832083                        if ( empty( $wp_query->comments ) ) {
    20842084                                return;
    20852085                        }
    2086                         if ( 'all' != $r['type'] ) {
     2086                        if ( 'all' != $parsed_args['type'] ) {
    20872087                                if ( empty( $wp_query->comments_by_type ) ) {
    20882088                                        $wp_query->comments_by_type = separate_comments( $wp_query->comments );
    20892089                                }
    2090                                 if ( empty( $wp_query->comments_by_type[ $r['type'] ] ) ) {
     2090                                if ( empty( $wp_query->comments_by_type[ $parsed_args['type'] ] ) ) {
    20912091                                        return;
    20922092                                }
    2093                                 $_comments = $wp_query->comments_by_type[ $r['type'] ];
     2093                                $_comments = $wp_query->comments_by_type[ $parsed_args['type'] ];
    20942094                        } else {
    20952095                                $_comments = $wp_query->comments;
    20962096                        }
     
    20992099                                $default_comments_page = get_option( 'default_comments_page' );
    21002100                                $cpage                 = get_query_var( 'cpage' );
    21012101                                if ( 'newest' === $default_comments_page ) {
    2102                                         $r['cpage'] = $cpage;
     2102                                        $parsed_args['cpage'] = $cpage;
    21032103
    21042104                                        /*
    21052105                                        * When first page shows oldest comments, post permalink is the same as
     
    21062106                                        * the comment permalink.
    21072107                                        */
    21082108                                } elseif ( $cpage == 1 ) {
    2109                                         $r['cpage'] = '';
     2109                                        $parsed_args['cpage'] = '';
    21102110                                } else {
    2111                                         $r['cpage'] = $cpage;
     2111                                        $parsed_args['cpage'] = $cpage;
    21122112                                }
    21132113
    2114                                 $r['page']     = 0;
    2115                                 $r['per_page'] = 0;
     2114                                $parsed_args['page']     = 0;
     2115                                $parsed_args['per_page'] = 0;
    21162116                        }
    21172117                }
    21182118        }
    21192119
    2120         if ( '' === $r['per_page'] && get_option( 'page_comments' ) ) {
    2121                 $r['per_page'] = get_query_var( 'comments_per_page' );
     2120        if ( '' === $parsed_args['per_page'] && get_option( 'page_comments' ) ) {
     2121                $parsed_args['per_page'] = get_query_var( 'comments_per_page' );
    21222122        }
    21232123
    2124         if ( empty( $r['per_page'] ) ) {
    2125                 $r['per_page'] = 0;
    2126                 $r['page']     = 0;
     2124        if ( empty( $parsed_args['per_page'] ) ) {
     2125                $parsed_args['per_page'] = 0;
     2126                $parsed_args['page']     = 0;
    21272127        }
    21282128
    2129         if ( '' === $r['max_depth'] ) {
     2129        if ( '' === $parsed_args['max_depth'] ) {
    21302130                if ( get_option( 'thread_comments' ) ) {
    2131                         $r['max_depth'] = get_option( 'thread_comments_depth' );
     2131                        $parsed_args['max_depth'] = get_option( 'thread_comments_depth' );
    21322132                } else {
    2133                         $r['max_depth'] = -1;
     2133                        $parsed_args['max_depth'] = -1;
    21342134                }
    21352135        }
    21362136
    2137         if ( '' === $r['page'] ) {
     2137        if ( '' === $parsed_args['page'] ) {
    21382138                if ( empty( $overridden_cpage ) ) {
    2139                         $r['page'] = get_query_var( 'cpage' );
     2139                        $parsed_args['page'] = get_query_var( 'cpage' );
    21402140                } else {
    2141                         $threaded  = ( -1 != $r['max_depth'] );
    2142                         $r['page'] = ( 'newest' == get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $r['per_page'], $threaded ) : 1;
    2143                         set_query_var( 'cpage', $r['page'] );
     2141                        $threaded  = ( -1 != $parsed_args['max_depth'] );
     2142                        $parsed_args['page'] = ( 'newest' == get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $r['per_page'], $threaded ) : 1;
     2143                        set_query_var( 'cpage', $parsed_args['page'] );
    21442144                }
    21452145        }
    21462146        // Validation check
    2147         $r['page'] = intval( $r['page'] );
    2148         if ( 0 == $r['page'] && 0 != $r['per_page'] ) {
    2149                 $r['page'] = 1;
     2147        $parsed_args['page'] = intval( $parsed_args['page'] );
     2148        if ( 0 == $parsed_args['page'] && 0 != $parsed_args['per_page'] ) {
     2149                $parsed_args['page'] = 1;
    21502150        }
    21512151
    2152         if ( null === $r['reverse_top_level'] ) {
    2153                 $r['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );
     2152        if ( null === $parsed_args['reverse_top_level'] ) {
     2153                $parsed_args['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );
    21542154        }
    21552155
    21562156        wp_queue_comments_for_comment_meta_lazyload( $_comments );
    21572157
    2158         if ( empty( $r['walker'] ) ) {
     2158        if ( empty( $parsed_args['walker'] ) ) {
    21592159                $walker = new Walker_Comment;
    21602160        } else {
    2161                 $walker = $r['walker'];
     2161                $walker = $parsed_args['walker'];
    21622162        }
    21632163
    2164         $output = $walker->paged_walk( $_comments, $r['max_depth'], $r['page'], $r['per_page'], $r );
     2164        $output = $walker->paged_walk( $_comments, $parsed_args['max_depth'], $parsed_args['page'], $parsed_args['per_page'], $parsed_args );
    21652165
    21662166        $in_comment_loop = false;
    21672167
    2168         if ( $r['echo'] ) {
     2168        if ( $parsed_args['echo'] ) {
    21692169                echo $output;
    21702170        } else {
    21712171                return $output;
  • wp-includes/comment.php

     
    168168                'post_id' => $post_id,
    169169                'order'   => 'ASC',
    170170        );
    171         $r        = wp_parse_args( $args, $defaults );
     171        $parsed_args        = wp_parse_args( $args, $defaults );
    172172
    173173        $query = new WP_Comment_Query;
    174         return $query->query( $r );
     174        return $query->query( $parsed_args );
    175175}
    176176
    177177/**
  • wp-includes/deprecated.php

     
    430430                'title_li' => '',
    431431        );
    432432
    433         $r = wp_parse_args( $args, $defaults );
     433        $parsed_args = wp_parse_args( $args, $defaults );
    434434
    435         return wp_list_bookmarks($r);
     435        return wp_list_bookmarks($parsed_args);
    436436}
    437437
    438438/**
     
    635635function wp_list_cats($args = '') {
    636636        _deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );
    637637
    638         $r = wp_parse_args( $args );
     638        $parsed_args = wp_parse_args( $args );
    639639
    640640        // Map to new names.
    641         if ( isset($r['optionall']) && isset($r['all']))
    642                 $r['show_option_all'] = $r['all'];
    643         if ( isset($r['sort_column']) )
    644                 $r['orderby'] = $r['sort_column'];
    645         if ( isset($r['sort_order']) )
    646                 $r['order'] = $r['sort_order'];
    647         if ( isset($r['optiondates']) )
    648                 $r['show_last_update'] = $r['optiondates'];
    649         if ( isset($r['optioncount']) )
    650                 $r['show_count'] = $r['optioncount'];
    651         if ( isset($r['list']) )
    652                 $r['style'] = $r['list'] ? 'list' : 'break';
    653         $r['title_li'] = '';
     641        if ( isset($parsed_args['optionall']) && isset($parsed_args['all']))
     642                $parsed_args['show_option_all'] = $parsed_args['all'];
     643        if ( isset($parsed_args['sort_column']) )
     644                $parsed_args['orderby'] = $parsed_args['sort_column'];
     645        if ( isset($parsed_args['sort_order']) )
     646                $parsed_args['order'] = $parsed_args['sort_order'];
     647        if ( isset($parsed_args['optiondates']) )
     648                $parsed_args['show_last_update'] = $parsed_args['optiondates'];
     649        if ( isset($parsed_args['optioncount']) )
     650                $parsed_args['show_count'] = $parsed_args['optioncount'];
     651        if ( isset($parsed_args['list']) )
     652                $parsed_args['style'] = $parsed_args['list'] ? 'list' : 'break';
     653        $parsed_args['title_li'] = '';
    654654
    655         return wp_list_categories($r);
     655        return wp_list_categories($parsed_args);
    656656}
    657657
    658658/**
     
    892892                'title_li' => '',
    893893        );
    894894
    895         $r = wp_parse_args( $args, $defaults );
     895        $parsed_args = wp_parse_args( $args, $defaults );
    896896
    897         return wp_list_bookmarks($r);
     897        return wp_list_bookmarks($parsed_args);
    898898}
    899899
    900900/**
  • wp-includes/functions.php

     
    29332933 */
    29342934function _default_wp_die_handler( $message, $title = '', $args = array() ) {
    29352935        $defaults = array( 'response' => 500 );
    2936         $r        = wp_parse_args( $args, $defaults );
     2936        $parsed_args        = wp_parse_args( $args, $defaults );
    29372937
    29382938        $have_gettext = function_exists( '__' );
    29392939
     
    29602960                $message = "<p>$message</p>";
    29612961        }
    29622962
    2963         if ( isset( $r['back_link'] ) && $r['back_link'] ) {
     2963        if ( isset( $parsed_args['back_link'] ) && $parsed_args['back_link'] ) {
    29642964                $back_text = $have_gettext ? __( '&laquo; Back' ) : '&laquo; Back';
    29652965                $message  .= "\n<p><a href='javascript:history.back()'>$back_text</a></p>";
    29662966        }
     
    29672967
    29682968        if ( ! did_action( 'admin_head' ) ) :
    29692969                if ( ! headers_sent() ) {
    2970                         status_header( $r['response'] );
     2970                        status_header( $parsed_args['response'] );
    29712971                        nocache_headers();
    29722972                        header( 'Content-Type: text/html; charset=utf-8' );
    29732973                }
     
    29772977                }
    29782978
    29792979                $text_direction = 'ltr';
    2980                 if ( isset( $r['text_direction'] ) && 'rtl' == $r['text_direction'] ) {
     2980                if ( isset( $parsed_args['text_direction'] ) && 'rtl' == $parsed_args['text_direction'] ) {
    29812981                        $text_direction = 'rtl';
    29822982                } elseif ( function_exists( 'is_rtl' ) && is_rtl() ) {
    29832983                        $text_direction = 'rtl';
     
    31443144        global $wp_xmlrpc_server;
    31453145        $defaults = array( 'response' => 500 );
    31463146
    3147         $r = wp_parse_args( $args, $defaults );
     3147        $parsed_args = wp_parse_args( $args, $defaults );
    31483148
    31493149        if ( $wp_xmlrpc_server ) {
    3150                 $error = new IXR_Error( $r['response'], $message );
     3150                $error = new IXR_Error( $parsed_args['response'], $message );
    31513151                $wp_xmlrpc_server->output( $error->getXml() );
    31523152        }
    31533153        die();
     
    31693169        $defaults = array(
    31703170                'response' => 200,
    31713171        );
    3172         $r        = wp_parse_args( $args, $defaults );
     3172        $parsed_args        = wp_parse_args( $args, $defaults );
    31733173
    3174         if ( ! headers_sent() && null !== $r['response'] ) {
    3175                 status_header( $r['response'] );
     3174        if ( ! headers_sent() && null !== $parsed_args['response'] ) {
     3175                status_header( $parsed_args['response'] );
    31763176        }
    31773177
    31783178        if ( is_scalar( $message ) ) {
  • wp-includes/general-template.php

     
    17461746                'post_type'       => 'post',
    17471747        );
    17481748
    1749         $r = wp_parse_args( $args, $defaults );
     1749        $parsed_args = wp_parse_args( $args, $defaults );
    17501750
    1751         $post_type_object = get_post_type_object( $r['post_type'] );
     1751        $post_type_object = get_post_type_object( $parsed_args['post_type'] );
    17521752        if ( ! is_post_type_viewable( $post_type_object ) ) {
    17531753                return;
    17541754        }
    1755         $r['post_type'] = $post_type_object->name;
     1755        $parsed_args['post_type'] = $post_type_object->name;
    17561756
    1757         if ( '' == $r['type'] ) {
    1758                 $r['type'] = 'monthly';
     1757        if ( '' == $parsed_args['type'] ) {
     1758                $parsed_args['type'] = 'monthly';
    17591759        }
    17601760
    1761         if ( ! empty( $r['limit'] ) ) {
    1762                 $r['limit'] = absint( $r['limit'] );
    1763                 $r['limit'] = ' LIMIT ' . $r['limit'];
     1761        if ( ! empty( $parsed_args['limit'] ) ) {
     1762                $parsed_args['limit'] = absint( $parsed_args['limit'] );
     1763                $parsed_args['limit'] = ' LIMIT ' . $parsed_args['limit'];
    17641764        }
    17651765
    1766         $order = strtoupper( $r['order'] );
     1766        $order = strtoupper( $parsed_args['order'] );
    17671767        if ( $order !== 'ASC' ) {
    17681768                $order = 'DESC';
    17691769        }
     
    17711771        // this is what will separate dates on weekly archive links
    17721772        $archive_week_separator = '&#8211;';
    17731773
    1774         $sql_where = $wpdb->prepare( "WHERE post_type = %s AND post_status = 'publish'", $r['post_type'] );
     1774        $sql_where = $wpdb->prepare( "WHERE post_type = %s AND post_status = 'publish'", $parsed_args['post_type'] );
    17751775
    17761776        /**
    17771777         * Filters the SQL WHERE clause for retrieving archives.
     
    17791779         * @since 2.2.0
    17801780         *
    17811781         * @param string $sql_where Portion of SQL query containing the WHERE clause.
    1782          * @param array  $r         An array of default arguments.
     1782         * @param array  $parsed_args         An array of default arguments.
    17831783         */
    1784         $where = apply_filters( 'getarchives_where', $sql_where, $r );
     1784        $where = apply_filters( 'getarchives_where', $sql_where, $parsed_args );
    17851785
    17861786        /**
    17871787         * Filters the SQL JOIN clause for retrieving archives.
     
    17891789         * @since 2.2.0
    17901790         *
    17911791         * @param string $sql_join Portion of SQL query containing JOIN clause.
    1792          * @param array  $r        An array of default arguments.
     1792         * @param array  $parsed_args        An array of default arguments.
    17931793         */
    1794         $join = apply_filters( 'getarchives_join', '', $r );
     1794        $join = apply_filters( 'getarchives_join', '', $parsed_args );
    17951795
    17961796        $output = '';
    17971797
    17981798        $last_changed = wp_cache_get_last_changed( 'posts' );
    17991799
    1800         $limit = $r['limit'];
     1800        $limit = $parsed_args['limit'];
    18011801
    1802         if ( 'monthly' == $r['type'] ) {
     1802        if ( 'monthly' == $parsed_args['type'] ) {
    18031803                $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date) ORDER BY post_date $order $limit";
    18041804                $key   = md5( $query );
    18051805                $key   = "wp_get_archives:$key:$last_changed";
     
    18081808                        wp_cache_set( $key, $results, 'posts' );
    18091809                }
    18101810                if ( $results ) {
    1811                         $after = $r['after'];
     1811                        $after = $parsed_args['after'];
    18121812                        foreach ( (array) $results as $result ) {
    18131813                                $url = get_month_link( $result->year, $result->month );
    1814                                 if ( 'post' !== $r['post_type'] ) {
    1815                                         $url = add_query_arg( 'post_type', $r['post_type'], $url );
     1814                                if ( 'post' !== $parsed_args['post_type'] ) {
     1815                                        $url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );
    18161816                                }
    18171817                                /* translators: 1: month name, 2: 4-digit year */
    18181818                                $text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $result->month ), $result->year );
    1819                                 if ( $r['show_post_count'] ) {
    1820                                         $r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
     1819                                if ( $parsed_args['show_post_count'] ) {
     1820                                        $parsed_args['after'] = '&nbsp;(' . $result->posts . ')' . $after;
    18211821                                }
    1822                                 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
     1822                                $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'] );
    18231823                        }
    18241824                }
    1825         } elseif ( 'yearly' == $r['type'] ) {
     1825        } elseif ( 'yearly' == $parsed_args['type'] ) {
    18261826                $query = "SELECT YEAR(post_date) AS `year`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date) ORDER BY post_date $order $limit";
    18271827                $key   = md5( $query );
    18281828                $key   = "wp_get_archives:$key:$last_changed";
     
    18311831                        wp_cache_set( $key, $results, 'posts' );
    18321832                }
    18331833                if ( $results ) {
    1834                         $after = $r['after'];
     1834                        $after = $parsed_args['after'];
    18351835                        foreach ( (array) $results as $result ) {
    18361836                                $url = get_year_link( $result->year );
    1837                                 if ( 'post' !== $r['post_type'] ) {
    1838                                         $url = add_query_arg( 'post_type', $r['post_type'], $url );
     1837                                if ( 'post' !== $parsed_args['post_type'] ) {
     1838                                        $url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );
    18391839                                }
    18401840                                $text = sprintf( '%d', $result->year );
    1841                                 if ( $r['show_post_count'] ) {
    1842                                         $r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
     1841                                if ( $parsed_args['show_post_count'] ) {
     1842                                        $parsed_args['after'] = '&nbsp;(' . $result->posts . ')' . $after;
    18431843                                }
    1844                                 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
     1844                                $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'] );
    18451845                        }
    18461846                }
    1847         } elseif ( 'daily' == $r['type'] ) {
     1847        } elseif ( 'daily' == $parsed_args['type'] ) {
    18481848                $query = "SELECT YEAR(post_date) AS `year`, MONTH(post_date) AS `month`, DAYOFMONTH(post_date) AS `dayofmonth`, count(ID) as posts FROM $wpdb->posts $join $where GROUP BY YEAR(post_date), MONTH(post_date), DAYOFMONTH(post_date) ORDER BY post_date $order $limit";
    18491849                $key   = md5( $query );
    18501850                $key   = "wp_get_archives:$key:$last_changed";
     
    18531853                        wp_cache_set( $key, $results, 'posts' );
    18541854                }
    18551855                if ( $results ) {
    1856                         $after = $r['after'];
     1856                        $after = $parsed_args['after'];
    18571857                        foreach ( (array) $results as $result ) {
    18581858                                $url = get_day_link( $result->year, $result->month, $result->dayofmonth );
    1859                                 if ( 'post' !== $r['post_type'] ) {
    1860                                         $url = add_query_arg( 'post_type', $r['post_type'], $url );
     1859                                if ( 'post' !== $parsed_args['post_type'] ) {
     1860                                        $url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );
    18611861                                }
    18621862                                $date = sprintf( '%1$d-%2$02d-%3$02d 00:00:00', $result->year, $result->month, $result->dayofmonth );
    18631863                                $text = mysql2date( get_option( 'date_format' ), $date );
    1864                                 if ( $r['show_post_count'] ) {
    1865                                         $r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
     1864                                if ( $parsed_args['show_post_count'] ) {
     1865                                        $parsed_args['after'] = '&nbsp;(' . $result->posts . ')' . $after;
    18661866                                }
    1867                                 $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
     1867                                $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'] );
    18681868                        }
    18691869                }
    1870         } elseif ( 'weekly' == $r['type'] ) {
     1870        } elseif ( 'weekly' == $parsed_args['type'] ) {
    18711871                $week  = _wp_mysql_week( '`post_date`' );
    18721872                $query = "SELECT DISTINCT $week AS `week`, YEAR( `post_date` ) AS `yr`, DATE_FORMAT( `post_date`, '%Y-%m-%d' ) AS `yyyymmdd`, count( `ID` ) AS `posts` FROM `$wpdb->posts` $join $where GROUP BY $week, YEAR( `post_date` ) ORDER BY `post_date` $order $limit";
    18731873                $key   = md5( $query );
     
    18781878                }
    18791879                $arc_w_last = '';
    18801880                if ( $results ) {
    1881                         $after = $r['after'];
     1881                        $after = $parsed_args['after'];
    18821882                        foreach ( (array) $results as $result ) {
    18831883                                if ( $result->week != $arc_w_last ) {
    18841884                                        $arc_year       = $result->yr;
     
    18931893                                                ),
    18941894                                                home_url( '/' )
    18951895                                        );
    1896                                         if ( 'post' !== $r['post_type'] ) {
    1897                                                 $url = add_query_arg( 'post_type', $r['post_type'], $url );
     1896                                        if ( 'post' !== $parsed_args['post_type'] ) {
     1897                                                $url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );
    18981898                                        }
    18991899                                        $text = $arc_week_start . $archive_week_separator . $arc_week_end;
    1900                                         if ( $r['show_post_count'] ) {
    1901                                                 $r['after'] = '&nbsp;(' . $result->posts . ')' . $after;
     1900                                        if ( $parsed_args['show_post_count'] ) {
     1901                                                $parsed_args['after'] = '&nbsp;(' . $result->posts . ')' . $after;
    19021902                                        }
    1903                                         $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
     1903                                        $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'] );
    19041904                                }
    19051905                        }
    19061906                }
    1907         } elseif ( ( 'postbypost' == $r['type'] ) || ( 'alpha' == $r['type'] ) ) {
    1908                 $orderby = ( 'alpha' == $r['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC ';
     1907        } elseif ( ( 'postbypost' == $parsed_args['type'] ) || ( 'alpha' == $parsed_args['type'] ) ) {
     1908                $orderby = ( 'alpha' == $parsed_args['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC ';
    19091909                $query   = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
    19101910                $key     = md5( $query );
    19111911                $key     = "wp_get_archives:$key:$last_changed";
     
    19231923                                        } else {
    19241924                                                $text = $result->ID;
    19251925                                        }
    1926                                         $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'] );
     1926                                        $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'] );
    19271927                                }
    19281928                        }
    19291929                }
    19301930        }
    1931         if ( $r['echo'] ) {
     1931        if ( $parsed_args['echo'] ) {
    19321932                echo $output;
    19331933        } else {
    19341934                return $output;
  • wp-includes/post-template.php

     
    8484                'echo'   => true,
    8585                'post'   => get_post(),
    8686        );
    87         $r        = wp_parse_args( $args, $defaults );
     87        $parsed_args        = wp_parse_args( $args, $defaults );
    8888
    89         $title = get_the_title( $r['post'] );
     89        $title = get_the_title( $parsed_args['post'] );
    9090
    9191        if ( strlen( $title ) == 0 ) {
    9292                return;
    9393        }
    9494
    95         $title = $r['before'] . $title . $r['after'];
     95        $title = $parsed_args['before'] . $title . $parsed_args['after'];
    9696        $title = esc_attr( strip_tags( $title ) );
    9797
    98         if ( $r['echo'] ) {
     98        if ( $parsed_args['echo'] ) {
    9999                echo $title;
    100100        } else {
    101101                return $title;
     
    11481148                'value_field'           => 'ID',
    11491149        );
    11501150
    1151         $r = wp_parse_args( $args, $defaults );
     1151        $parsed_args = wp_parse_args( $args, $defaults );
    11521152
    1153         $pages  = get_pages( $r );
     1153        $pages  = get_pages( $parsed_args );
    11541154        $output = '';
    11551155        // Back-compat with old system where both id and name were based on $name argument
    1156         if ( empty( $r['id'] ) ) {
    1157                 $r['id'] = $r['name'];
     1156        if ( empty( $parsed_args['id'] ) ) {
     1157                $parsed_args['id'] = $parsed_args['name'];
    11581158        }
    11591159
    11601160        if ( ! empty( $pages ) ) {
    11611161                $class = '';
    1162                 if ( ! empty( $r['class'] ) ) {
    1163                         $class = " class='" . esc_attr( $r['class'] ) . "'";
     1162                if ( ! empty( $parsed_args['class'] ) ) {
     1163                        $class = " class='" . esc_attr( $parsed_args['class'] ) . "'";
    11641164                }
    11651165
    1166                 $output = "<select name='" . esc_attr( $r['name'] ) . "'" . $class . " id='" . esc_attr( $r['id'] ) . "'>\n";
    1167                 if ( $r['show_option_no_change'] ) {
    1168                         $output .= "\t<option value=\"-1\">" . $r['show_option_no_change'] . "</option>\n";
     1166                $output = "<select name='" . esc_attr( $parsed_args['name'] ) . "'" . $class . " id='" . esc_attr( $parsed_args['id'] ) . "'>\n";
     1167                if ( $parsed_args['show_option_no_change'] ) {
     1168                        $output .= "\t<option value=\"-1\">" . $parsed_args['show_option_no_change'] . "</option>\n";
    11691169                }
    1170                 if ( $r['show_option_none'] ) {
    1171                         $output .= "\t<option value=\"" . esc_attr( $r['option_none_value'] ) . '">' . $r['show_option_none'] . "</option>\n";
     1170                if ( $parsed_args['show_option_none'] ) {
     1171                        $output .= "\t<option value=\"" . esc_attr( $parsed_args['option_none_value'] ) . '">' . $parsed_args['show_option_none'] . "</option>\n";
    11721172                }
    1173                 $output .= walk_page_dropdown_tree( $pages, $r['depth'], $r );
     1173                $output .= walk_page_dropdown_tree( $pages, $parsed_args['depth'], $parsed_args );
    11741174                $output .= "</select>\n";
    11751175        }
    11761176
  • wp-includes/post.php

     
    550550                'post_parent' => 0,
    551551        );
    552552
    553         $r = wp_parse_args( $args, $defaults );
     553        $parsed_args = wp_parse_args( $args, $defaults );
    554554
    555         $children = get_posts( $r );
     555        $children = get_posts( $parsed_args );
    556556
    557557        if ( ! $children ) {
    558558                return $kids;
    559559        }
    560560
    561         if ( ! empty( $r['fields'] ) ) {
     561        if ( ! empty( $parsed_args['fields'] ) ) {
    562562                return $children;
    563563        }
    564564
     
    18601860                'suppress_filters' => true,
    18611861        );
    18621862
    1863         $r = wp_parse_args( $args, $defaults );
    1864         if ( empty( $r['post_status'] ) ) {
    1865                 $r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
     1863        $parsed_args = wp_parse_args( $args, $defaults );
     1864        if ( empty( $parsed_args['post_status'] ) ) {
     1865                $parsed_args['post_status'] = ( 'attachment' == $parsed_args['post_type'] ) ? 'inherit' : 'publish';
    18661866        }
    1867         if ( ! empty( $r['numberposts'] ) && empty( $r['posts_per_page'] ) ) {
    1868                 $r['posts_per_page'] = $r['numberposts'];
     1867        if ( ! empty( $parsed_args['numberposts'] ) && empty( $parsed_args['posts_per_page'] ) ) {
     1868                $parsed_args['posts_per_page'] = $parsed_args['numberposts'];
    18691869        }
    1870         if ( ! empty( $r['category'] ) ) {
    1871                 $r['cat'] = $r['category'];
     1870        if ( ! empty( $parsed_args['category'] ) ) {
     1871                $parsed_args['cat'] = $parsed_args['category'];
    18721872        }
    1873         if ( ! empty( $r['include'] ) ) {
    1874                 $incposts            = wp_parse_id_list( $r['include'] );
    1875                 $r['posts_per_page'] = count( $incposts );  // only the number of posts included
    1876                 $r['post__in']       = $incposts;
    1877         } elseif ( ! empty( $r['exclude'] ) ) {
    1878                 $r['post__not_in'] = wp_parse_id_list( $r['exclude'] );
     1873        if ( ! empty( $parsed_args['include'] ) ) {
     1874                $incposts            = wp_parse_id_list( $parsed_args['include'] );
     1875                $parsed_args['posts_per_page'] = count( $incposts );  // only the number of posts included
     1876                $parsed_args['post__in']       = $incposts;
     1877        } elseif ( ! empty( $parsed_args['exclude'] ) ) {
     1878                $parsed_args['post__not_in'] = wp_parse_id_list( $parsed_args['exclude'] );
    18791879        }
    18801880
    1881         $r['ignore_sticky_posts'] = true;
    1882         $r['no_found_rows']       = true;
     1881        $parsed_args['ignore_sticky_posts'] = true;
     1882        $parsed_args['no_found_rows']       = true;
    18831883
    18841884        $get_posts = new WP_Query;
    1885         return $get_posts->query( $r );
     1885        return $get_posts->query( $parsed_args );
    18861886
    18871887}
    18881888
     
    32403240                'suppress_filters' => true,
    32413241        );
    32423242
    3243         $r = wp_parse_args( $args, $defaults );
     3243        $parsed_args = wp_parse_args( $args, $defaults );
    32443244
    3245         $results = get_posts( $r );
     3245        $results = get_posts( $parsed_args );
    32463246
    32473247        // Backward compatibility. Prior to 3.1 expected posts to be returned in array.
    32483248        if ( ARRAY_A == $output ) {
     
    49374937                'post_status'  => 'publish',
    49384938        );
    49394939
    4940         $r = wp_parse_args( $args, $defaults );
     4940        $parsed_args = wp_parse_args( $args, $defaults );
    49414941
    4942         $number       = (int) $r['number'];
    4943         $offset       = (int) $r['offset'];
    4944         $child_of     = (int) $r['child_of'];
    4945         $hierarchical = $r['hierarchical'];
    4946         $exclude      = $r['exclude'];
    4947         $meta_key     = $r['meta_key'];
    4948         $meta_value   = $r['meta_value'];
    4949         $parent       = $r['parent'];
    4950         $post_status  = $r['post_status'];
     4942        $number       = (int) $parsed_args['number'];
     4943        $offset       = (int) $parsed_args['offset'];
     4944        $child_of     = (int) $parsed_args['child_of'];
     4945        $hierarchical = $parsed_args['hierarchical'];
     4946        $exclude      = $parsed_args['exclude'];
     4947        $meta_key     = $parsed_args['meta_key'];
     4948        $meta_value   = $parsed_args['meta_value'];
     4949        $parent       = $parsed_args['parent'];
     4950        $post_status  = $parsed_args['post_status'];
    49514951
    49524952        // Make sure the post type is hierarchical.
    49534953        $hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );
    4954         if ( ! in_array( $r['post_type'], $hierarchical_post_types ) ) {
     4954        if ( ! in_array( $parsed_args['post_type'], $hierarchical_post_types ) ) {
    49554955                return false;
    49564956        }
    49574957
     
    49684968        }
    49694969
    49704970        // $args can be whatever, only use the args defined in defaults to compute the key.
    4971         $key          = md5( serialize( wp_array_slice_assoc( $r, array_keys( $defaults ) ) ) );
     4971        $key          = md5( serialize( wp_array_slice_assoc( $parsed_args, array_keys( $defaults ) ) ) );
    49724972        $last_changed = wp_cache_get_last_changed( 'posts' );
    49734973
    49744974        $cache_key = "get_pages:$key:$last_changed";
     
    49764976                // Convert to WP_Post instances.
    49774977                $pages = array_map( 'get_post', $cache );
    49784978                /** This filter is documented in wp-includes/post.php */
    4979                 $pages = apply_filters( 'get_pages', $pages, $r );
     4979                $pages = apply_filters( 'get_pages', $pages, $parsed_args );
    49804980                return $pages;
    49814981        }
    49824982
    49834983        $inclusions = '';
    4984         if ( ! empty( $r['include'] ) ) {
     4984        if ( ! empty( $parsed_args['include'] ) ) {
    49854985                $child_of     = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include
    49864986                $parent       = -1;
    49874987                $exclude      = '';
     
    49884988                $meta_key     = '';
    49894989                $meta_value   = '';
    49904990                $hierarchical = false;
    4991                 $incpages     = wp_parse_id_list( $r['include'] );
     4991                $incpages     = wp_parse_id_list( $parsed_args['include'] );
    49924992                if ( ! empty( $incpages ) ) {
    49934993                        $inclusions = ' AND ID IN (' . implode( ',', $incpages ) . ')';
    49944994                }
     
    50035003        }
    50045004
    50055005        $author_query = '';
    5006         if ( ! empty( $r['authors'] ) ) {
    5007                 $post_authors = preg_split( '/[\s,]+/', $r['authors'] );
     5006        if ( ! empty( $parsed_args['authors'] ) ) {
     5007                $post_authors = preg_split( '/[\s,]+/', $parsed_args['authors'] );
    50085008
    50095009                if ( ! empty( $post_authors ) ) {
    50105010                        foreach ( $post_authors as $post_author ) {
     
    50585058        }
    50595059
    50605060        if ( 1 == count( $post_status ) ) {
    5061                 $where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $r['post_type'], reset( $post_status ) );
     5061                $where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $parsed_args['post_type'], reset( $post_status ) );
    50625062        } else {
    50635063                $post_status     = implode( "', '", $post_status );
    5064                 $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $r['post_type'] );
     5064                $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $parsed_args['post_type'] );
    50655065        }
    50665066
    50675067        $orderby_array = array();
     
    50865086                'comment_count',
    50875087        );
    50885088
    5089         foreach ( explode( ',', $r['sort_column'] ) as $orderby ) {
     5089        foreach ( explode( ',', $parsed_args['sort_column'] ) as $orderby ) {
    50905090                $orderby = trim( $orderby );
    50915091                if ( ! in_array( $orderby, $allowed_keys ) ) {
    50925092                        continue;
     
    51175117        }
    51185118        $sort_column = ! empty( $orderby_array ) ? implode( ',', $orderby_array ) : "$wpdb->posts.post_title";
    51195119
    5120         $sort_order = strtoupper( $r['sort_order'] );
     5120        $sort_order = strtoupper( $parsed_args['sort_order'] );
    51215121        if ( '' !== $sort_order && ! in_array( $sort_order, array( 'ASC', 'DESC' ) ) ) {
    51225122                $sort_order = 'ASC';
    51235123        }
     
    51345134
    51355135        if ( empty( $pages ) ) {
    51365136                /** This filter is documented in wp-includes/post.php */
    5137                 $pages = apply_filters( 'get_pages', array(), $r );
     5137                $pages = apply_filters( 'get_pages', array(), $parsed_args );
    51385138                return $pages;
    51395139        }
    51405140
     
    51515151                $pages = get_page_children( $child_of, $pages );
    51525152        }
    51535153
    5154         if ( ! empty( $r['exclude_tree'] ) ) {
    5155                 $exclude = wp_parse_id_list( $r['exclude_tree'] );
     5154        if ( ! empty( $parsed_args['exclude_tree'] ) ) {
     5155                $exclude = wp_parse_id_list( $parsed_args['exclude_tree'] );
    51565156                foreach ( $exclude as $id ) {
    51575157                        $children = get_page_children( $id, $pages );
    51585158                        foreach ( $children as $child ) {
     
    51845184         * @since 2.1.0
    51855185         *
    51865186         * @param array $pages List of pages to retrieve.
    5187          * @param array $r     Array of get_pages() arguments.
     5187         * @param array $parsed_args     Array of get_pages() arguments.
    51885188         */
    5189         return apply_filters( 'get_pages', $pages, $r );
     5189        return apply_filters( 'get_pages', $pages, $parsed_args );
    51905190}
    51915191
    51925192//
  • wp-includes/taxonomy.php

     
    43224322                'after'  => '',
    43234323        );
    43244324
    4325         $r = wp_parse_args( $args, $defaults );
     4325        $parsed_args = wp_parse_args( $args, $defaults );
    43264326
    4327         echo $r['before'] . join( $r['sep'], get_the_taxonomies( $r['post'], $r ) ) . $r['after'];
     4327        echo $parsed_args['before'] . join( $parsed_args['sep'], get_the_taxonomies( $parsed_args['post'], $parsed_args ) ) . $parsed_args['after'];
    43284328}
    43294329
    43304330/**
  • wp-includes/user.php

     
    11041104
    11051105        $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
    11061106
    1107         $r = wp_parse_args( $args, $defaults );
     1107        $parsed_args = wp_parse_args( $args, $defaults );
    11081108
    1109         $query_args = wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who', 'role', 'role__in', 'role__not_in' ) );
     1109        $query_args = wp_array_slice_assoc( $parsed_args, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who', 'role', 'role__in', 'role__not_in' ) );
    11101110
    11111111        $fields = array( 'ID', 'user_login' );
    11121112
    1113         $show = ! empty( $r['show'] ) ? $r['show'] : 'display_name';
     1113        $show = ! empty( $parsed_args['show'] ) ? $parsed_args['show'] : 'display_name';
    11141114        if ( 'display_name_with_login' === $show ) {
    11151115                $fields[] = 'display_name';
    11161116        } else {
     
    11191119
    11201120        $query_args['fields'] = $fields;
    11211121
    1122         $show_option_all   = $r['show_option_all'];
    1123         $show_option_none  = $r['show_option_none'];
    1124         $option_none_value = $r['option_none_value'];
     1122        $show_option_all   = $parsed_args['show_option_all'];
     1123        $show_option_none  = $parsed_args['show_option_none'];
     1124        $option_none_value = $parsed_args['option_none_value'];
    11251125
    11261126        /**
    11271127         * Filters the query arguments for the list of users in the dropdown.
     
    11291129         * @since 4.4.0
    11301130         *
    11311131         * @param array $query_args The query arguments for get_users().
    1132          * @param array $r          The arguments passed to wp_dropdown_users() combined with the defaults.
     1132         * @param array $parsed_args          The arguments passed to wp_dropdown_users() combined with the defaults.
    11331133         */
    1134         $query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $r );
     1134        $query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $parsed_args );
    11351135
    11361136        $users = get_users( $query_args );
    11371137
    11381138        $output = '';
    1139         if ( ! empty( $users ) && ( empty( $r['hide_if_only_one_author'] ) || count( $users ) > 1 ) ) {
    1140                 $name = esc_attr( $r['name'] );
    1141                 if ( $r['multi'] && ! $r['id'] ) {
     1139        if ( ! empty( $users ) && ( empty( $parsed_args['hide_if_only_one_author'] ) || count( $users ) > 1 ) ) {
     1140                $name = esc_attr( $parsed_args['name'] );
     1141                if ( $parsed_args['multi'] && ! $parsed_args['id'] ) {
    11421142                        $id = '';
    11431143                } else {
    1144                         $id = $r['id'] ? " id='" . esc_attr( $r['id'] ) . "'" : " id='$name'";
     1144                        $id = $parsed_args['id'] ? " id='" . esc_attr( $parsed_args['id'] ) . "'" : " id='$name'";
    11451145                }
    1146                 $output = "<select name='{$name}'{$id} class='" . $r['class'] . "'>\n";
     1146                $output = "<select name='{$name}'{$id} class='" . $parsed_args['class'] . "'>\n";
    11471147
    11481148                if ( $show_option_all ) {
    11491149                        $output .= "\t<option value='0'>$show_option_all</option>\n";
     
    11501150                }
    11511151
    11521152                if ( $show_option_none ) {
    1153                         $_selected = selected( $option_none_value, $r['selected'], false );
     1153                        $_selected = selected( $option_none_value, $parsed_args['selected'], false );
    11541154                        $output   .= "\t<option value='" . esc_attr( $option_none_value ) . "'$_selected>$show_option_none</option>\n";
    11551155                }
    11561156
    1157                 if ( $r['include_selected'] && ( $r['selected'] > 0 ) ) {
     1157                if ( $parsed_args['include_selected'] && ( $parsed_args['selected'] > 0 ) ) {
    11581158                        $found_selected = false;
    1159                         $r['selected']  = (int) $r['selected'];
     1159                        $parsed_args['selected']  = (int) $parsed_args['selected'];
    11601160                        foreach ( (array) $users as $user ) {
    11611161                                $user->ID = (int) $user->ID;
    1162                                 if ( $user->ID === $r['selected'] ) {
     1162                                if ( $user->ID === $parsed_args['selected'] ) {
    11631163                                        $found_selected = true;
    11641164                                }
    11651165                        }
    11661166
    11671167                        if ( ! $found_selected ) {
    1168                                 $users[] = get_userdata( $r['selected'] );
     1168                                $users[] = get_userdata( $parsed_args['selected'] );
    11691169                        }
    11701170                }
    11711171
     
    11791179                                $display = '(' . $user->user_login . ')';
    11801180                        }
    11811181
    1182                         $_selected = selected( $user->ID, $r['selected'], false );
     1182                        $_selected = selected( $user->ID, $parsed_args['selected'], false );
    11831183                        $output   .= "\t<option value='$user->ID'$_selected>" . esc_html( $display ) . "</option>\n";
    11841184                }
    11851185
     
    11951195         */
    11961196        $html = apply_filters( 'wp_dropdown_users', $output );
    11971197
    1198         if ( $r['echo'] ) {
     1198        if ( $parsed_args['echo'] ) {
    11991199                echo $html;
    12001200        }
    12011201        return $html;