@@ -1310,12 +1310,12 @@ function link_advanced_meta_box( $link ) {
|
diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php
index 76bce5d20c..d6f56b7e78 100644
--- a/wp-admin/includes/ms.php
+++ b/wp-admin/includes/ms.php
@@ -1089,7 +1089,7 @@ function network_edit_site_nav( $args = array() ) {
);
// Parse arguments
- $r = wp_parse_args(
+ $parsed_args = wp_parse_args(
$args,
array(
'blog_id' => isset( $_GET['blog_id'] ) ? (int) $_GET['blog_id'] : 0,
@@ -1102,10 +1102,10 @@ function network_edit_site_nav( $args = array() ) {
$screen_links = array();
// Loop through tabs
- foreach ( $r['links'] as $link_id => $link ) {
+ foreach ( $parsed_args['links'] as $link_id => $link ) {
// Skip link if user can't access
- if ( ! current_user_can( $link['cap'], $r['blog_id'] ) ) {
+ if ( ! current_user_can( $link['cap'], $parsed_args['blog_id'] ) ) {
continue;
}
@@ -1116,7 +1116,7 @@ function network_edit_site_nav( $args = array() ) {
$aria_current = '';
// Selected is set by the parent OR assumed by the $pagenow global
- if ( $r['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
+ if ( $parsed_args['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
$classes[] = 'nav-tab-active';
$aria_current = ' aria-current="page"';
}
@@ -1125,7 +1125,7 @@ function network_edit_site_nav( $args = array() ) {
$esc_classes = implode( ' ', $classes );
// Get the URL for this link
- $url = add_query_arg( array( 'id' => $r['blog_id'] ), network_admin_url( $link['url'] ) );
+ $url = add_query_arg( array( 'id' => $parsed_args['blog_id'] ), network_admin_url( $link['url'] ) );
// Add link to nav links
$screen_links[ $link_id ] = '' . esc_html( $link['label'] ) . '';
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 9c6a48d019..5c4f4d8a3a 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -100,33 +100,33 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
*/
$params = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
- $r = wp_parse_args( $params, $defaults );
+ $parsed_args = wp_parse_args( $params, $defaults );
- if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) {
+ if ( empty( $parsed_args['walker'] ) || ! ( $parsed_args['walker'] instanceof Walker ) ) {
$walker = new Walker_Category_Checklist;
} else {
- $walker = $r['walker'];
+ $walker = $parsed_args['walker'];
}
- $taxonomy = $r['taxonomy'];
- $descendants_and_self = (int) $r['descendants_and_self'];
+ $taxonomy = $parsed_args['taxonomy'];
+ $descendants_and_self = (int) $parsed_args['descendants_and_self'];
$args = array( 'taxonomy' => $taxonomy );
$tax = get_taxonomy( $taxonomy );
$args['disabled'] = ! current_user_can( $tax->cap->assign_terms );
- $args['list_only'] = ! empty( $r['list_only'] );
+ $args['list_only'] = ! empty( $parsed_args['list_only'] );
- if ( is_array( $r['selected_cats'] ) ) {
- $args['selected_cats'] = $r['selected_cats'];
+ if ( is_array( $parsed_args['selected_cats'] ) ) {
+ $args['selected_cats'] = $parsed_args['selected_cats'];
} elseif ( $post_id ) {
$args['selected_cats'] = wp_get_object_terms( $post_id, $taxonomy, array_merge( $args, array( 'fields' => 'ids' ) ) );
} else {
$args['selected_cats'] = array();
}
- if ( is_array( $r['popular_cats'] ) ) {
- $args['popular_cats'] = $r['popular_cats'];
+ if ( is_array( $parsed_args['popular_cats'] ) ) {
+ $args['popular_cats'] = $parsed_args['popular_cats'];
} else {
$args['popular_cats'] = get_terms(
$taxonomy,
@@ -156,7 +156,7 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
$output = '';
- if ( $r['checked_ontop'] ) {
+ if ( $parsed_args['checked_ontop'] ) {
// 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)
$checked_categories = array();
$keys = array_keys( $categories );
@@ -174,7 +174,7 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
// Then the rest of them
$output .= call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) );
- if ( $r['echo'] ) {
+ if ( $parsed_args['echo'] ) {
echo $output;
}
@@ -2441,19 +2441,19 @@ function _local_storage_notice() {
* @return string Star rating HTML.
*/
function wp_star_rating( $args = array() ) {
- $defaults = array(
+ $defaults = array(
'rating' => 0,
'type' => 'rating',
'number' => 0,
'echo' => true,
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
// Non-English decimal places when the $rating is coming from a string
- $rating = (float) str_replace( ',', '.', $r['rating'] );
+ $rating = (float) str_replace( ',', '.', $parsed_args['rating'] );
// Convert Percentage to star rating, 0..5 in .5 increments
- if ( 'percent' === $r['type'] ) {
+ if ( 'percent' === $parsed_args['type'] ) {
$rating = round( $rating / 10, 0 ) / 2;
}
@@ -2462,10 +2462,10 @@ function wp_star_rating( $args = array() ) {
$half_stars = ceil( $rating - $full_stars );
$empty_stars = 5 - $full_stars - $half_stars;
- if ( $r['number'] ) {
+ if ( $parsed_args['number'] ) {
/* translators: 1: the rating, 2: the number of ratings */
- $format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $r['number'] );
- $title = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $r['number'] ) );
+ $format = _n( '%1$s rating based on %2$s rating', '%1$s rating based on %2$s ratings', $parsed_args['number'] );
+ $title = sprintf( $format, number_format_i18n( $rating, 1 ), number_format_i18n( $parsed_args['number'] ) );
} else {
/* translators: %s: the rating */
$title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
@@ -2478,7 +2478,7 @@ function wp_star_rating( $args = array() ) {
$output .= str_repeat( '', $empty_stars );
$output .= '';
- if ( $r['echo'] ) {
+ if ( $parsed_args['echo'] ) {
echo $output;
}
diff --git a/wp-includes/bookmark-template.php b/wp-includes/bookmark-template.php
index 85804125fb..8975a004d2 100644
--- a/wp-includes/bookmark-template.php
+++ b/wp-includes/bookmark-template.php
@@ -62,7 +62,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
'link_after' => '',
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
$output = ''; // Blank string to start with.
@@ -70,8 +70,8 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
if ( ! isset( $bookmark->recently_updated ) ) {
$bookmark->recently_updated = false;
}
- $output .= $r['before'];
- if ( $r['show_updated'] && $bookmark->recently_updated ) {
+ $output .= $parsed_args['before'];
+ if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {
$output .= '';
}
$the_link = '#';
@@ -82,7 +82,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
$name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) );
$title = $desc;
- if ( $r['show_updated'] ) {
+ if ( $parsed_args['show_updated'] ) {
if ( '00' != substr( $bookmark->link_updated_f, 0, 2 ) ) {
$title .= ' (';
$title .= sprintf(
@@ -95,7 +95,7 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
$title .= ')';
}
}
- $alt = ' alt="' . $name . ( $r['show_description'] ? ' ' . $title : '' ) . '"';
+ $alt = ' alt="' . $name . ( $parsed_args['show_description'] ? ' ' . $title : '' ) . '"';
if ( '' != $title ) {
$title = ' title="' . $title . '"';
@@ -110,42 +110,42 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
}
$output .= '';
- $output .= $r['link_before'];
+ $output .= $parsed_args['link_before'];
- if ( $bookmark->link_image != null && $r['show_images'] ) {
+ if ( $bookmark->link_image != null && $parsed_args['show_images'] ) {
if ( strpos( $bookmark->link_image, 'http' ) === 0 ) {
$output .= "link_image\" $alt $title />";
} else { // If it's a relative path
$output .= 'link_image\" $alt $title />";
}
- if ( $r['show_name'] ) {
+ if ( $parsed_args['show_name'] ) {
$output .= " $name";
}
} else {
$output .= $name;
}
- $output .= $r['link_after'];
+ $output .= $parsed_args['link_after'];
$output .= '';
- if ( $r['show_updated'] && $bookmark->recently_updated ) {
+ if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {
$output .= '';
}
- if ( $r['show_description'] && '' != $desc ) {
- $output .= $r['between'] . $desc;
+ if ( $parsed_args['show_description'] && '' != $desc ) {
+ $output .= $parsed_args['between'] . $desc;
}
- if ( $r['show_rating'] ) {
- $output .= $r['between'] . sanitize_bookmark_field(
+ if ( $parsed_args['show_rating'] ) {
+ $output .= $parsed_args['between'] . sanitize_bookmark_field(
'link_rating',
$bookmark->link_rating,
$bookmark->link_id,
'display'
);
}
- $output .= $r['after'] . "\n";
+ $output .= $parsed_args['after'] . "\n";
} // end while
return $output;
@@ -225,45 +225,45 @@ function wp_list_bookmarks( $args = '' ) {
'category_after' => '',
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
$output = '';
- if ( ! is_array( $r['class'] ) ) {
- $r['class'] = explode( ' ', $r['class'] );
+ if ( ! is_array( $parsed_args['class'] ) ) {
+ $parsed_args['class'] = explode( ' ', $parsed_args['class'] );
}
- $r['class'] = array_map( 'sanitize_html_class', $r['class'] );
- $r['class'] = trim( join( ' ', $r['class'] ) );
+ $parsed_args['class'] = array_map( 'sanitize_html_class', $parsed_args['class'] );
+ $parsed_args['class'] = trim( join( ' ', $parsed_args['class'] ) );
- if ( $r['categorize'] ) {
+ if ( $parsed_args['categorize'] ) {
$cats = get_terms(
'link_category',
array(
- 'name__like' => $r['category_name'],
- 'include' => $r['category'],
- 'exclude' => $r['exclude_category'],
- 'orderby' => $r['category_orderby'],
- 'order' => $r['category_order'],
+ 'name__like' => $parsed_args['category_name'],
+ 'include' => $parsed_args['category'],
+ 'exclude' => $parsed_args['exclude_category'],
+ 'orderby' => $parsed_args['category_orderby'],
+ 'order' => $parsed_args['category_order'],
'hierarchical' => 0,
)
);
if ( empty( $cats ) ) {
- $r['categorize'] = false;
+ $parsed_args['categorize'] = false;
}
}
- if ( $r['categorize'] ) {
+ if ( $parsed_args['categorize'] ) {
// Split the bookmarks into ul's for each category
foreach ( (array) $cats as $cat ) {
- $params = array_merge( $r, array( 'category' => $cat->term_id ) );
+ $params = array_merge( $parsed_args, array( 'category' => $cat->term_id ) );
$bookmarks = get_bookmarks( $params );
if ( empty( $bookmarks ) ) {
continue;
}
$output .= str_replace(
array( '%id', '%class' ),
- array( "linkcat-$cat->term_id", $r['class'] ),
- $r['category_before']
+ array( "linkcat-$cat->term_id", $parsed_args['class'] ),
+ $parsed_args['category_before']
);
/**
* Filters the category name.
@@ -274,34 +274,34 @@ function wp_list_bookmarks( $args = '' ) {
*/
$catname = apply_filters( 'link_category', $cat->name );
- $output .= $r['title_before'];
+ $output .= $parsed_args['title_before'];
$output .= $catname;
- $output .= $r['title_after'];
+ $output .= $parsed_args['title_after'];
$output .= "\n\t\n";
- $output .= _walk_bookmarks( $bookmarks, $r );
+ $output .= _walk_bookmarks( $bookmarks, $parsed_args );
$output .= "\n\t \n";
- $output .= $r['category_after'] . "\n";
+ $output .= $parsed_args['category_after'] . "\n";
}
} else {
//output one single list using title_li for the title
- $bookmarks = get_bookmarks( $r );
+ $bookmarks = get_bookmarks( $parsed_args );
if ( ! empty( $bookmarks ) ) {
- if ( ! empty( $r['title_li'] ) ) {
+ if ( ! empty( $parsed_args['title_li'] ) ) {
$output .= str_replace(
array( '%id', '%class' ),
- array( 'linkcat-' . $r['category'], $r['class'] ),
- $r['category_before']
+ array( 'linkcat-' . $parsed_args['category'], $parsed_args['class'] ),
+ $parsed_args['category_before']
);
- $output .= $r['title_before'];
- $output .= $r['title_li'];
- $output .= $r['title_after'];
+ $output .= $parsed_args['title_before'];
+ $output .= $parsed_args['title_li'];
+ $output .= $parsed_args['title_after'];
$output .= "\n\t\n";
- $output .= _walk_bookmarks( $bookmarks, $r );
+ $output .= _walk_bookmarks( $bookmarks, $parsed_args );
$output .= "\n\t \n";
- $output .= $r['category_after'] . "\n";
+ $output .= $parsed_args['category_after'] . "\n";
} else {
- $output .= _walk_bookmarks( $bookmarks, $r );
+ $output .= _walk_bookmarks( $bookmarks, $parsed_args );
}
}
}
@@ -315,7 +315,7 @@ function wp_list_bookmarks( $args = '' ) {
*/
$html = apply_filters( 'wp_list_bookmarks', $output );
- if ( ! $r['echo'] ) {
+ if ( ! $parsed_args['echo'] ) {
return $html;
}
echo $html;
diff --git a/wp-includes/bookmark.php b/wp-includes/bookmark.php
index fee37ce109..fd2c926591 100644
--- a/wp-includes/bookmark.php
+++ b/wp-includes/bookmark.php
@@ -139,11 +139,12 @@ function get_bookmarks( $args = '' ) {
'search' => '',
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
- $key = md5( serialize( $r ) );
+ $key = md5( serialize( $parsed_args ) );
$cache = wp_cache_get( 'get_bookmarks', 'bookmark' );
- if ( 'rand' !== $r['orderby'] && $cache ) {
+
+ if ( 'rand' !== $parsed_args['orderby'] && $cache ) {
if ( is_array( $cache ) && isset( $cache[ $key ] ) ) {
$bookmarks = $cache[ $key ];
/**
@@ -159,9 +160,9 @@ function get_bookmarks( $args = '' ) {
* @see get_bookmarks()
*
* @param array $bookmarks List of the cached bookmarks.
- * @param array $r An array of bookmark query arguments.
+ * @param array $parsed_args An array of bookmark query arguments.
*/
- return apply_filters( 'get_bookmarks', $bookmarks, $r );
+ return apply_filters( 'get_bookmarks', $bookmarks, $parsed_args );
}
}
@@ -170,11 +171,12 @@ function get_bookmarks( $args = '' ) {
}
$inclusions = '';
- if ( ! empty( $r['include'] ) ) {
- $r['exclude'] = ''; //ignore exclude, category, and category_name params if using include
- $r['category'] = '';
- $r['category_name'] = '';
- $inclinks = wp_parse_id_list( $r['include'] );
+ if ( ! empty( $parsed_args['include'] ) ) {
+ $parsed_args['exclude'] = ''; //ignore exclude, category, and category_name params if using include
+ $parsed_args['category'] = '';
+ $parsed_args['category_name'] = '';
+
+ $inclinks = wp_parse_id_list( $parsed_args['include'] );
if ( count( $inclinks ) ) {
foreach ( $inclinks as $inclink ) {
if ( empty( $inclusions ) ) {
@@ -190,8 +192,8 @@ function get_bookmarks( $args = '' ) {
}
$exclusions = '';
- if ( ! empty( $r['exclude'] ) ) {
- $exlinks = wp_parse_id_list( $r['exclude'] );
+ if ( ! empty( $parsed_args['exclude'] ) ) {
+ $exlinks = wp_parse_id_list( $parsed_args['exclude'] );
if ( count( $exlinks ) ) {
foreach ( $exlinks as $exlink ) {
if ( empty( $exclusions ) ) {
@@ -206,28 +208,28 @@ function get_bookmarks( $args = '' ) {
$exclusions .= ')';
}
- if ( ! empty( $r['category_name'] ) ) {
- $r['category'] = get_term_by( 'name', $r['category_name'], 'link_category' );
- if ( $r['category'] ) {
- $r['category'] = $r['category']->term_id;
+ if ( ! empty( $parsed_args['category_name'] ) ) {
+ $parsed_args['category'] = get_term_by( 'name', $parsed_args['category_name'], 'link_category' );
+ if ( $parsed_args['category'] ) {
+ $parsed_args['category'] = $parsed_args['category']->term_id;
} else {
$cache[ $key ] = array();
wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
/** This filter is documented in wp-includes/bookmark.php */
- return apply_filters( 'get_bookmarks', array(), $r );
+ return apply_filters( 'get_bookmarks', array(), $parsed_args );
}
}
$search = '';
- if ( ! empty( $r['search'] ) ) {
- $like = '%' . $wpdb->esc_like( $r['search'] ) . '%';
+ if ( ! empty( $parsed_args['search'] ) ) {
+ $like = '%' . $wpdb->esc_like( $parsed_args['search'] ) . '%';
$search = $wpdb->prepare( ' AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ', $like, $like, $like );
}
$category_query = '';
$join = '';
- if ( ! empty( $r['category'] ) ) {
- $incategories = wp_parse_id_list( $r['category'] );
+ if ( ! empty( $parsed_args['category'] ) ) {
+ $incategories = wp_parse_id_list( $parsed_args['category'] );
if ( count( $incategories ) ) {
foreach ( $incategories as $incat ) {
if ( empty( $category_query ) ) {
@@ -243,15 +245,15 @@ function get_bookmarks( $args = '' ) {
$join = " INNER JOIN $wpdb->term_relationships AS tr ON ($wpdb->links.link_id = tr.object_id) INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_taxonomy_id = tr.term_taxonomy_id";
}
- if ( $r['show_updated'] ) {
+ if ( $parsed_args['show_updated'] ) {
$recently_updated_test = ', IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated ';
} else {
$recently_updated_test = '';
}
- $get_updated = ( $r['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
+ $get_updated = ( $parsed_args['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
- $orderby = strtolower( $r['orderby'] );
+ $orderby = strtolower( $parsed_args['orderby'] );
$length = '';
switch ( $orderby ) {
case 'length':
@@ -282,21 +284,21 @@ function get_bookmarks( $args = '' ) {
$orderby = 'link_name';
}
- $order = strtoupper( $r['order'] );
+ $order = strtoupper( $parsed_args['order'] );
if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ) ) ) {
$order = 'ASC';
}
$visible = '';
- if ( $r['hide_invisible'] ) {
+ if ( $parsed_args['hide_invisible'] ) {
$visible = "AND link_visible = 'Y'";
}
$query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query";
$query .= " $exclusions $inclusions $search";
$query .= " ORDER BY $orderby $order";
- if ( $r['limit'] != -1 ) {
- $query .= ' LIMIT ' . $r['limit'];
+ if ( $parsed_args['limit'] != -1 ) {
+ $query .= ' LIMIT ' . $parsed_args['limit'];
}
$results = $wpdb->get_results( $query );
@@ -307,7 +309,7 @@ function get_bookmarks( $args = '' ) {
}
/** This filter is documented in wp-includes/bookmark.php */
- return apply_filters( 'get_bookmarks', $results, $r );
+ return apply_filters( 'get_bookmarks', $results, $parsed_args );
}
/**
diff --git a/wp-includes/category-template.php b/wp-includes/category-template.php
index 1b2da3c122..fd06fa14e5 100644
--- a/wp-includes/category-template.php
+++ b/wp-includes/category-template.php
@@ -365,14 +365,15 @@ function wp_dropdown_categories( $args = '' ) {
$args['taxonomy'] = 'link_category';
}
- $r = wp_parse_args( $args, $defaults );
- $option_none_value = $r['option_none_value'];
+ // Parse incoming $args into an array and merge it with $defaults
+ $parsed_args = wp_parse_args( $args, $defaults );
+ $option_none_value = $args['option_none_value'];
- if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
- $r['pad_counts'] = true;
+ if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {
+ $parsed_args['pad_counts'] = true;
}
- $tab_index = $r['tab_index'];
+ $tab_index = $parsed_args['tab_index'];
$tab_index_attribute = '';
if ( (int) $tab_index > 0 ) {
@@ -380,21 +381,21 @@ function wp_dropdown_categories( $args = '' ) {
}
// Avoid clashes with the 'name' param of get_terms().
- $get_terms_args = $r;
+ $get_terms_args = $parsed_args;
unset( $get_terms_args['name'] );
- $categories = get_terms( $r['taxonomy'], $get_terms_args );
+ $categories = get_terms( $parsed_args['taxonomy'], $get_terms_args );
- $name = esc_attr( $r['name'] );
- $class = esc_attr( $r['class'] );
- $id = $r['id'] ? esc_attr( $r['id'] ) : $name;
- $required = $r['required'] ? 'required' : '';
+ $name = esc_attr( $parsed_args['name'] );
+ $class = esc_attr( $parsed_args['class'] );
+ $id = $parsed_args['id'] ? esc_attr( $parsed_args['id'] ) : $name;
+ $required = $parsed_args['required'] ? 'required' : '';
- if ( ! $r['hide_if_empty'] || ! empty( $categories ) ) {
+ if ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) {
$output = "\n";
}
/**
@@ -450,11 +451,11 @@ function wp_dropdown_categories( $args = '' ) {
* @since 2.1.0
*
* @param string $output HTML output.
- * @param array $r Arguments used to build the drop-down.
+ * @param array $parsed_args Arguments used to build the drop-down.
*/
- $output = apply_filters( 'wp_dropdown_cats', $output, $r );
+ $output = apply_filters( 'wp_dropdown_cats', $output, $parsed_args );
- if ( $r['echo'] ) {
+ if ( $parsed_args['echo'] ) {
echo $output;
}
return $output;
@@ -537,48 +538,48 @@ function wp_list_categories( $args = '' ) {
'use_desc_for_title' => 1,
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
- if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
- $r['pad_counts'] = true;
+ if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {
+ $parsed_args['pad_counts'] = true;
}
// Descendants of exclusions should be excluded too.
- if ( true == $r['hierarchical'] ) {
+ if ( true == $parsed_args['hierarchical'] ) {
$exclude_tree = array();
- if ( $r['exclude_tree'] ) {
- $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude_tree'] ) );
+ if ( $parsed_args['exclude_tree'] ) {
+ $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude_tree'] ) );
}
- if ( $r['exclude'] ) {
- $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude'] ) );
+ if ( $parsed_args['exclude'] ) {
+ $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude'] ) );
}
- $r['exclude_tree'] = $exclude_tree;
- $r['exclude'] = '';
+ $parsed_args['exclude_tree'] = $exclude_tree;
+ $parsed_args['exclude'] = '';
}
- if ( ! isset( $r['class'] ) ) {
- $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy'];
+ if ( ! isset( $parsed_args['class'] ) ) {
+ $parsed_args['class'] = ( 'category' == $parsed_args['taxonomy'] ) ? 'categories' : $parsed_args['taxonomy'];
}
- if ( ! taxonomy_exists( $r['taxonomy'] ) ) {
+ if ( ! taxonomy_exists( $parsed_args['taxonomy'] ) ) {
return false;
}
- $show_option_all = $r['show_option_all'];
- $show_option_none = $r['show_option_none'];
+ $show_option_all = $parsed_args['show_option_all'];
+ $show_option_none = $parsed_args['show_option_none'];
- $categories = get_categories( $r );
+ $categories = get_categories( $parsed_args );
$output = '';
- if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) {
- $output = '- ' . $r['title_li'] . '
';
+ if ( $parsed_args['title_li'] && 'list' == $parsed_args['style'] && ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] ) ) {
+ $output = '- ' . $parsed_args['title_li'] . '
';
}
if ( empty( $categories ) ) {
if ( ! empty( $show_option_none ) ) {
- if ( 'list' == $r['style'] ) {
+ if ( 'list' == $parsed_args['style'] ) {
$output .= '- ' . $show_option_none . '
';
} else {
$output .= $show_option_none;
@@ -590,7 +591,7 @@ function wp_list_categories( $args = '' ) {
$posts_page = '';
// For taxonomies that belong only to custom post types, point to a valid archive.
- $taxonomy_object = get_taxonomy( $r['taxonomy'] );
+ $taxonomy_object = get_taxonomy( $parsed_args['taxonomy'] );
if ( ! in_array( 'post', $taxonomy_object->object_type ) && ! in_array( 'page', $taxonomy_object->object_type ) ) {
foreach ( $taxonomy_object->object_type as $object_type ) {
$_object_type = get_post_type_object( $object_type );
@@ -613,29 +614,29 @@ function wp_list_categories( $args = '' ) {
}
$posts_page = esc_url( $posts_page );
- if ( 'list' == $r['style'] ) {
+ if ( 'list' == $parsed_args['style'] ) {
$output .= "- $show_option_all
";
} else {
$output .= "$show_option_all";
}
}
- if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
+ if ( empty( $parsed_args['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
$current_term_object = get_queried_object();
- if ( $current_term_object && $r['taxonomy'] === $current_term_object->taxonomy ) {
- $r['current_category'] = get_queried_object_id();
+ if ( $current_term_object && $parsed_args['taxonomy'] === $current_term_object->taxonomy ) {
+ $parsed_args['current_category'] = get_queried_object_id();
}
}
- if ( $r['hierarchical'] ) {
- $depth = $r['depth'];
+ if ( $parsed_args['hierarchical'] ) {
+ $depth = $parsed_args['depth'];
} else {
$depth = -1; // Flat.
}
- $output .= walk_category_tree( $categories, $depth, $r );
+ $output .= walk_category_tree( $categories, $depth, $parsed_args );
}
- if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) {
+ if ( $parsed_args['title_li'] && 'list' == $parsed_args['style'] && ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] ) ) {
$output .= ' ';
}
@@ -649,7 +650,7 @@ function wp_list_categories( $args = '' ) {
*/
$html = apply_filters( 'wp_list_categories', $output, $args );
- if ( $r['echo'] ) {
+ if ( $parsed_args['echo'] ) {
echo $html;
} else {
return $html;
diff --git a/wp-includes/class-http.php b/wp-includes/class-http.php
index 9f9e49174d..03511056ae 100644
--- a/wp-includes/class-http.php
+++ b/wp-includes/class-http.php
@@ -220,20 +220,20 @@ class WP_Http {
$defaults['redirection'] = 0;
}
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
/**
* Filters the arguments used in an HTTP request.
*
* @since 2.7.0
*
- * @param array $r An array of HTTP request arguments.
+ * @param array $parsed_args An array of HTTP request arguments.
* @param string $url The request URL.
*/
- $r = apply_filters( 'http_request_args', $r, $url );
+ $parsed_args = apply_filters( 'http_request_args', $parsed_args, $url );
// The transports decrement this, store a copy of the original value for loop purposes.
- if ( ! isset( $r['_redirection'] ) ) {
- $r['_redirection'] = $r['redirection'];
+ if ( ! isset( $parsed_args['_redirection'] ) ) {
+ $parsed_args['_redirection'] = $parsed_args['redirection'];
}
/**
@@ -251,17 +251,17 @@ class WP_Http {
* @since 2.9.0
*
* @param false|array|WP_Error $preempt Whether to preempt an HTTP request's return value. Default false.
- * @param array $r HTTP request arguments.
+ * @param array $parsed_args HTTP request arguments.
* @param string $url The request URL.
*/
- $pre = apply_filters( 'pre_http_request', false, $r, $url );
+ $pre = apply_filters( 'pre_http_request', false, $parsed_args, $url );
if ( false !== $pre ) {
return $pre;
}
if ( function_exists( 'wp_kses_bad_protocol' ) ) {
- if ( $r['reject_unsafe_urls'] ) {
+ if ( $parsed_args['reject_unsafe_urls'] ) {
$url = wp_http_validate_url( $url );
}
if ( $url ) {
@@ -274,88 +274,88 @@ class WP_Http {
if ( empty( $url ) || empty( $arrURL['scheme'] ) ) {
$response = new WP_Error( 'http_request_failed', __( 'A valid URL was not provided.' ) );
/** This action is documented in wp-includes/class-http.php */
- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
+ do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
return $response;
}
if ( $this->block_request( $url ) ) {
$response = new WP_Error( 'http_request_not_executed', __( 'User has blocked requests through HTTP.' ) );
/** This action is documented in wp-includes/class-http.php */
- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
+ do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
return $response;
}
// If we are streaming to a file but no filename was given drop it in the WP temp dir
// and pick its name using the basename of the $url
- if ( $r['stream'] ) {
- if ( empty( $r['filename'] ) ) {
- $r['filename'] = get_temp_dir() . basename( $url );
+ if ( $parsed_args['stream'] ) {
+ if ( empty( $parsed_args['filename'] ) ) {
+ $parsed_args['filename'] = get_temp_dir() . basename( $url );
}
// Force some settings if we are streaming to a file and check for existence and perms of destination directory
- $r['blocking'] = true;
- if ( ! wp_is_writable( dirname( $r['filename'] ) ) ) {
+ $parsed_args['blocking'] = true;
+ if ( ! wp_is_writable( dirname( $parsed_args['filename'] ) ) ) {
$response = new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) );
/** This action is documented in wp-includes/class-http.php */
- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
+ do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
return $response;
}
}
- if ( is_null( $r['headers'] ) ) {
- $r['headers'] = array();
+ if ( is_null( $parsed_args['headers'] ) ) {
+ $parsed_args['headers'] = array();
}
// WP allows passing in headers as a string, weirdly.
- if ( ! is_array( $r['headers'] ) ) {
- $processedHeaders = WP_Http::processHeaders( $r['headers'] );
- $r['headers'] = $processedHeaders['headers'];
+ if ( ! is_array( $parsed_args['headers'] ) ) {
+ $processedHeaders = WP_Http::processHeaders( $parsed_args['headers'] );
+ $parsed_args['headers'] = $processedHeaders['headers'];
}
// Setup arguments
- $headers = $r['headers'];
- $data = $r['body'];
- $type = $r['method'];
+ $headers = $parsed_args['headers'];
+ $data = $parsed_args['body'];
+ $type = $parsed_args['method'];
$options = array(
- 'timeout' => $r['timeout'],
- 'useragent' => $r['user-agent'],
- 'blocking' => $r['blocking'],
- 'hooks' => new WP_HTTP_Requests_Hooks( $url, $r ),
+ 'timeout' => $parsed_args['timeout'],
+ 'useragent' => $parsed_args['user-agent'],
+ 'blocking' => $parsed_args['blocking'],
+ 'hooks' => new WP_HTTP_Requests_Hooks( $url, $parsed_args ),
);
// Ensure redirects follow browser behaviour.
$options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) );
// Validate redirected URLs.
- if ( function_exists( 'wp_kses_bad_protocol' ) && $r['reject_unsafe_urls'] ) {
+ if ( function_exists( 'wp_kses_bad_protocol' ) && $parsed_args['reject_unsafe_urls'] ) {
$options['hooks']->register( 'requests.before_redirect', array( get_class(), 'validate_redirects' ) );
}
- if ( $r['stream'] ) {
- $options['filename'] = $r['filename'];
+ if ( $parsed_args['stream'] ) {
+ $options['filename'] = $parsed_args['filename'];
}
- if ( empty( $r['redirection'] ) ) {
+ if ( empty( $parsed_args['redirection'] ) ) {
$options['follow_redirects'] = false;
} else {
- $options['redirects'] = $r['redirection'];
+ $options['redirects'] = $parsed_args['redirection'];
}
// Use byte limit, if we can
- if ( isset( $r['limit_response_size'] ) ) {
- $options['max_bytes'] = $r['limit_response_size'];
+ if ( isset( $parsed_args['limit_response_size'] ) ) {
+ $options['max_bytes'] = $parsed_args['limit_response_size'];
}
// If we've got cookies, use and convert them to Requests_Cookie.
- if ( ! empty( $r['cookies'] ) ) {
- $options['cookies'] = WP_Http::normalize_cookies( $r['cookies'] );
+ if ( ! empty( $parsed_args['cookies'] ) ) {
+ $options['cookies'] = WP_Http::normalize_cookies( $parsed_args['cookies'] );
}
// SSL certificate handling
- if ( ! $r['sslverify'] ) {
+ if ( ! $parsed_args['sslverify'] ) {
$options['verify'] = false;
$options['verifyname'] = false;
} else {
- $options['verify'] = $r['sslcertificates'];
+ $options['verify'] = $parsed_args['sslcertificates'];
}
// All non-GET/HEAD requests should put the arguments in the form body.
@@ -393,7 +393,7 @@ class WP_Http {
$requests_response = Requests::request( $url, $headers, $data, $type, $options );
// Convert the response into an array
- $http_response = new WP_HTTP_Requests_Response( $requests_response, $r['filename'] );
+ $http_response = new WP_HTTP_Requests_Response( $requests_response, $parsed_args['filename'] );
$response = $http_response->to_array();
// Add the original object to the array.
@@ -412,15 +412,15 @@ class WP_Http {
* @param array|WP_Error $response HTTP response or WP_Error object.
* @param string $context Context under which the hook is fired.
* @param string $class HTTP transport used.
- * @param array $r HTTP request arguments.
+ * @param array $parsed_args HTTP request arguments.
* @param string $url The request URL.
*/
- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
+ do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
if ( is_wp_error( $response ) ) {
return $response;
}
- if ( ! $r['blocking'] ) {
+ if ( ! $parsed_args['blocking'] ) {
return array(
'headers' => array(),
'body' => '',
@@ -439,10 +439,10 @@ class WP_Http {
* @since 2.9.0
*
* @param array $response HTTP response.
- * @param array $r HTTP request arguments.
+ * @param array $parsed_args HTTP request arguments.
* @param string $url The request URL.
*/
- return apply_filters( 'http_response', $response, $r, $url );
+ return apply_filters( 'http_response', $response, $parsed_args, $url );
}
/**
@@ -600,9 +600,9 @@ class WP_Http {
* @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
*/
public function post( $url, $args = array() ) {
- $defaults = array( 'method' => 'POST' );
- $r = wp_parse_args( $args, $defaults );
- return $this->request( $url, $r );
+ $defaults = array( 'method' => 'POST' );
+ $parsed_args = wp_parse_args( $args, $defaults );
+ return $this->request( $url, $parsed_args );
}
/**
@@ -617,9 +617,9 @@ class WP_Http {
* @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
*/
public function get( $url, $args = array() ) {
- $defaults = array( 'method' => 'GET' );
- $r = wp_parse_args( $args, $defaults );
- return $this->request( $url, $r );
+ $defaults = array( 'method' => 'GET' );
+ $parsed_args = wp_parse_args( $args, $defaults );
+ return $this->request( $url, $parsed_args );
}
/**
@@ -634,9 +634,9 @@ class WP_Http {
* @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
*/
public function head( $url, $args = array() ) {
- $defaults = array( 'method' => 'HEAD' );
- $r = wp_parse_args( $args, $defaults );
- return $this->request( $url, $r );
+ $defaults = array( 'method' => 'HEAD' );
+ $parsed_args = wp_parse_args( $args, $defaults );
+ return $this->request( $url, $parsed_args );
}
/**
diff --git a/wp-includes/class-wp-ajax-response.php b/wp-includes/class-wp-ajax-response.php
index 7a9c5b1077..b8505d5964 100644
--- a/wp-includes/class-wp-ajax-response.php
+++ b/wp-includes/class-wp-ajax-response.php
@@ -73,14 +73,14 @@ class WP_Ajax_Response {
'supplemental' => array(),
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
- $position = preg_replace( '/[^a-z0-9:_-]/i', '', $r['position'] );
- $id = $r['id'];
- $what = $r['what'];
- $action = $r['action'];
- $old_id = $r['old_id'];
- $data = $r['data'];
+ $position = preg_replace( '/[^a-z0-9:_-]/i', '', $parsed_args['position'] );
+ $id = $parsed_args['id'];
+ $what = $parsed_args['what'];
+ $action = $parsed_args['action'];
+ $old_id = $parsed_args['old_id'];
+ $data = $parsed_args['data'];
if ( is_wp_error( $id ) ) {
$data = $id;
@@ -118,8 +118,8 @@ class WP_Ajax_Response {
}
$s = '';
- if ( is_array( $r['supplemental'] ) ) {
- foreach ( $r['supplemental'] as $k => $v ) {
+ if ( is_array( $parsed_args['supplemental'] ) ) {
+ foreach ( $parsed_args['supplemental'] as $k => $v ) {
$s .= "<$k>$k>";
}
$s = "$s";
diff --git a/wp-includes/class-wp-http-curl.php b/wp-includes/class-wp-http-curl.php
index 5c280609fe..aa8593326e 100644
--- a/wp-includes/class-wp-http-curl.php
+++ b/wp-includes/class-wp-http-curl.php
@@ -79,18 +79,18 @@ class WP_Http_Curl {
'cookies' => array(),
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
- if ( isset( $r['headers']['User-Agent'] ) ) {
- $r['user-agent'] = $r['headers']['User-Agent'];
- unset( $r['headers']['User-Agent'] );
- } elseif ( isset( $r['headers']['user-agent'] ) ) {
- $r['user-agent'] = $r['headers']['user-agent'];
- unset( $r['headers']['user-agent'] );
+ if ( isset( $parsed_args['headers']['User-Agent'] ) ) {
+ $parsed_args['user-agent'] = $parsed_args['headers']['User-Agent'];
+ unset( $parsed_args['headers']['User-Agent'] );
+ } elseif ( isset( $parsed_args['headers']['user-agent'] ) ) {
+ $parsed_args['user-agent'] = $parsed_args['headers']['user-agent'];
+ unset( $parsed_args['headers']['user-agent'] );
}
// Construct Cookie: header if any cookies are set.
- WP_Http::buildCookieHeader( $r );
+ WP_Http::buildCookieHeader( $parsed_args );
$handle = curl_init();
@@ -109,8 +109,8 @@ class WP_Http_Curl {
}
}
- $is_local = isset( $r['local'] ) && $r['local'];
- $ssl_verify = isset( $r['sslverify'] ) && $r['sslverify'];
+ $is_local = isset( $parsed_args['local'] ) && $parsed_args['local'];
+ $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];
if ( $is_local ) {
/** This filter is documented in wp-includes/class-wp-http-streams.php */
$ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify, $url );
@@ -123,7 +123,7 @@ class WP_Http_Curl {
* CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since.
* a value of 0 will allow an unlimited timeout.
*/
- $timeout = (int) ceil( $r['timeout'] );
+ $timeout = (int) ceil( $parsed_args['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
@@ -133,10 +133,10 @@ class WP_Http_Curl {
curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );
if ( $ssl_verify ) {
- curl_setopt( $handle, CURLOPT_CAINFO, $r['sslcertificates'] );
+ curl_setopt( $handle, CURLOPT_CAINFO, $parsed_args['sslcertificates'] );
}
- curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
+ curl_setopt( $handle, CURLOPT_USERAGENT, $parsed_args['user-agent'] );
/*
* The option doesn't work with safe mode or when open_basedir is set, and there's
@@ -147,45 +147,45 @@ class WP_Http_Curl {
curl_setopt( $handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
}
- switch ( $r['method'] ) {
+ switch ( $parsed_args['method'] ) {
case 'HEAD':
curl_setopt( $handle, CURLOPT_NOBODY, true );
break;
case 'POST':
curl_setopt( $handle, CURLOPT_POST, true );
- curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
+ curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
break;
case 'PUT':
curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' );
- curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
+ curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
break;
default:
- curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $r['method'] );
- if ( ! is_null( $r['body'] ) ) {
- curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
+ curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $parsed_args['method'] );
+ if ( ! is_null( $parsed_args['body'] ) ) {
+ curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
}
break;
}
- if ( true === $r['blocking'] ) {
+ if ( true === $parsed_args['blocking'] ) {
curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) );
curl_setopt( $handle, CURLOPT_WRITEFUNCTION, array( $this, 'stream_body' ) );
}
curl_setopt( $handle, CURLOPT_HEADER, false );
- if ( isset( $r['limit_response_size'] ) ) {
- $this->max_body_length = intval( $r['limit_response_size'] );
+ if ( isset( $parsed_args['limit_response_size'] ) ) {
+ $this->max_body_length = intval( $parsed_args['limit_response_size'] );
} else {
$this->max_body_length = false;
}
// If streaming to a file open a file handle, and setup our curl streaming handler.
- if ( $r['stream'] ) {
+ if ( $parsed_args['stream'] ) {
if ( ! WP_DEBUG ) {
- $this->stream_handle = @fopen( $r['filename'], 'w+' );
+ $this->stream_handle = @fopen( $parsed_args['filename'], 'w+' );
} else {
- $this->stream_handle = fopen( $r['filename'], 'w+' );
+ $this->stream_handle = fopen( $parsed_args['filename'], 'w+' );
}
if ( ! $this->stream_handle ) {
return new WP_Error(
@@ -194,7 +194,7 @@ class WP_Http_Curl {
/* translators: 1: fopen(), 2: file name */
__( 'Could not open handle for %1$s to %2$s.' ),
'fopen()',
- $r['filename']
+ $parsed_args['filename']
)
);
}
@@ -202,16 +202,16 @@ class WP_Http_Curl {
$this->stream_handle = false;
}
- if ( ! empty( $r['headers'] ) ) {
+ if ( ! empty( $parsed_args['headers'] ) ) {
// cURL expects full header strings in each element.
$headers = array();
- foreach ( $r['headers'] as $name => $value ) {
+ foreach ( $parsed_args['headers'] as $name => $value ) {
$headers[] = "{$name}: $value";
}
curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );
}
- if ( $r['httpversion'] == '1.0' ) {
+ if ( $parsed_args['httpversion'] == '1.0' ) {
curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );
} else {
curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
@@ -226,13 +226,13 @@ class WP_Http_Curl {
* @since 2.8.0
*
* @param resource $handle The cURL handle returned by curl_init() (passed by reference).
- * @param array $r The HTTP request arguments.
+ * @param array $parsed_args The HTTP request arguments.
* @param string $url The request URL.
*/
- do_action_ref_array( 'http_api_curl', array( &$handle, $r, $url ) );
+ do_action_ref_array( 'http_api_curl', array( &$handle, $parsed_args, $url ) );
// We don't need to return the body, so don't. Just execute request and return.
- if ( ! $r['blocking'] ) {
+ if ( ! $parsed_args['blocking'] ) {
curl_exec( $handle );
$curl_error = curl_error( $handle );
@@ -272,7 +272,7 @@ class WP_Http_Curl {
if ( $curl_error || ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) ) {
if ( CURLE_WRITE_ERROR /* 23 */ == $curl_error ) {
if ( ! $this->max_body_length || $this->max_body_length != $bytes_written_total ) {
- if ( $r['stream'] ) {
+ if ( $parsed_args['stream'] ) {
curl_close( $handle );
fclose( $this->stream_handle );
return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );
@@ -296,7 +296,7 @@ class WP_Http_Curl {
curl_close( $handle );
- if ( $r['stream'] ) {
+ if ( $parsed_args['stream'] ) {
fclose( $this->stream_handle );
}
@@ -305,16 +305,16 @@ class WP_Http_Curl {
'body' => null,
'response' => $theHeaders['response'],
'cookies' => $theHeaders['cookies'],
- 'filename' => $r['filename'],
+ 'filename' => $parsed_args['filename'],
);
// Handle redirects.
- $redirect_response = WP_HTTP::handle_redirects( $url, $r, $response );
+ $redirect_response = WP_HTTP::handle_redirects( $url, $parsed_args, $response );
if ( false !== $redirect_response ) {
return $redirect_response;
}
- if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {
+ if ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {
$theBody = WP_Http_Encoding::decompress( $theBody );
}
diff --git a/wp-includes/class-wp-http-streams.php b/wp-includes/class-wp-http-streams.php
index ee7ea4d2a7..29c7dc0849 100644
--- a/wp-includes/class-wp-http-streams.php
+++ b/wp-includes/class-wp-http-streams.php
@@ -38,18 +38,18 @@ class WP_Http_Streams {
'cookies' => array(),
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
- if ( isset( $r['headers']['User-Agent'] ) ) {
- $r['user-agent'] = $r['headers']['User-Agent'];
- unset( $r['headers']['User-Agent'] );
- } elseif ( isset( $r['headers']['user-agent'] ) ) {
- $r['user-agent'] = $r['headers']['user-agent'];
- unset( $r['headers']['user-agent'] );
+ if ( isset( $parsed_args['headers']['User-Agent'] ) ) {
+ $parsed_args['user-agent'] = $parsed_args['headers']['User-Agent'];
+ unset( $parsed_args['headers']['User-Agent'] );
+ } elseif ( isset( $parsed_args['headers']['user-agent'] ) ) {
+ $parsed_args['user-agent'] = $parsed_args['headers']['user-agent'];
+ unset( $parsed_args['headers']['user-agent'] );
}
// Construct Cookie: header if any cookies are set.
- WP_Http::buildCookieHeader( $r );
+ WP_Http::buildCookieHeader( $parsed_args );
$arrURL = parse_url( $url );
@@ -70,13 +70,13 @@ class WP_Http_Streams {
$arrURL['path'] = '/';
}
- if ( isset( $r['headers']['Host'] ) || isset( $r['headers']['host'] ) ) {
- if ( isset( $r['headers']['Host'] ) ) {
- $arrURL['host'] = $r['headers']['Host'];
+ if ( isset( $parsed_args['headers']['Host'] ) || isset( $parsed_args['headers']['host'] ) ) {
+ if ( isset( $parsed_args['headers']['Host'] ) ) {
+ $arrURL['host'] = $parsed_args['headers']['Host'];
} else {
- $arrURL['host'] = $r['headers']['host'];
+ $arrURL['host'] = $parsed_args['headers']['host'];
}
- unset( $r['headers']['Host'], $r['headers']['host'] );
+ unset( $parsed_args['headers']['Host'], $parsed_args['headers']['host'] );
}
/*
@@ -90,8 +90,8 @@ class WP_Http_Streams {
$connect_host = $secure_transport ? 'ssl://' . $connect_host : 'tcp://' . $connect_host;
- $is_local = isset( $r['local'] ) && $r['local'];
- $ssl_verify = isset( $r['sslverify'] ) && $r['sslverify'];
+ $is_local = isset( $parsed_args['local'] ) && $parsed_args['local'];
+ $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];
if ( $is_local ) {
/**
* Filters whether SSL should be verified for local requests.
@@ -117,14 +117,14 @@ class WP_Http_Streams {
//'CN_match' => $arrURL['host'], // This is handled by self::verify_ssl_certificate()
'capture_peer_cert' => $ssl_verify,
'SNI_enabled' => true,
- 'cafile' => $r['sslcertificates'],
+ 'cafile' => $parsed_args['sslcertificates'],
'allow_self_signed' => ! $ssl_verify,
),
)
);
- $timeout = (int) floor( $r['timeout'] );
- $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000;
+ $timeout = (int) floor( $parsed_args['timeout'] );
+ $utimeout = $timeout == $parsed_args['timeout'] ? 0 : 1000000 * $parsed_args['timeout'] % 1000000;
$connect_timeout = max( $timeout, 1 );
// Store error number.
@@ -182,7 +182,7 @@ class WP_Http_Streams {
$requestPath = $arrURL['path'] . ( isset( $arrURL['query'] ) ? '?' . $arrURL['query'] : '' );
}
- $strHeaders = strtoupper( $r['method'] ) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
+ $strHeaders = strtoupper( $parsed_args['method'] ) . ' ' . $requestPath . ' HTTP/' . $parsed_args['httpversion'] . "\r\n";
$include_port_in_host_header = (
( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) ||
@@ -196,16 +196,16 @@ class WP_Http_Streams {
$strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n";
}
- if ( isset( $r['user-agent'] ) ) {
- $strHeaders .= 'User-agent: ' . $r['user-agent'] . "\r\n";
+ if ( isset( $parsed_args['user-agent'] ) ) {
+ $strHeaders .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n";
}
- if ( is_array( $r['headers'] ) ) {
- foreach ( (array) $r['headers'] as $header => $headerValue ) {
+ if ( is_array( $parsed_args['headers'] ) ) {
+ foreach ( (array) $parsed_args['headers'] as $header => $headerValue ) {
$strHeaders .= $header . ': ' . $headerValue . "\r\n";
}
} else {
- $strHeaders .= $r['headers'];
+ $strHeaders .= $parsed_args['headers'];
}
if ( $proxy->use_authentication() ) {
@@ -214,13 +214,13 @@ class WP_Http_Streams {
$strHeaders .= "\r\n";
- if ( ! is_null( $r['body'] ) ) {
- $strHeaders .= $r['body'];
+ if ( ! is_null( $parsed_args['body'] ) ) {
+ $strHeaders .= $parsed_args['body'];
}
fwrite( $handle, $strHeaders );
- if ( ! $r['blocking'] ) {
+ if ( ! $parsed_args['blocking'] ) {
stream_set_blocking( $handle, 0 );
fclose( $handle );
return array(
@@ -238,16 +238,16 @@ class WP_Http_Streams {
$bodyStarted = false;
$keep_reading = true;
$block_size = 4096;
- if ( isset( $r['limit_response_size'] ) ) {
- $block_size = min( $block_size, $r['limit_response_size'] );
+ if ( isset( $parsed_args['limit_response_size'] ) ) {
+ $block_size = min( $block_size, $parsed_args['limit_response_size'] );
}
// If streaming to a file setup the file handle.
- if ( $r['stream'] ) {
+ if ( $parsed_args['stream'] ) {
if ( ! WP_DEBUG ) {
- $stream_handle = @fopen( $r['filename'], 'w+' );
+ $stream_handle = @fopen( $parsed_args['filename'], 'w+' );
} else {
- $stream_handle = fopen( $r['filename'], 'w+' );
+ $stream_handle = fopen( $parsed_args['filename'], 'w+' );
}
if ( ! $stream_handle ) {
return new WP_Error(
@@ -256,7 +256,7 @@ class WP_Http_Streams {
/* translators: 1: fopen(), 2: file name */
__( 'Could not open handle for %1$s to %2$s.' ),
'fopen()',
- $r['filename']
+ $parsed_args['filename']
)
);
}
@@ -277,8 +277,8 @@ class WP_Http_Streams {
$this_block_size = strlen( $block );
- if ( isset( $r['limit_response_size'] ) && ( $bytes_written + $this_block_size ) > $r['limit_response_size'] ) {
- $this_block_size = ( $r['limit_response_size'] - $bytes_written );
+ if ( isset( $parsed_args['limit_response_size'] ) && ( $bytes_written + $this_block_size ) > $parsed_args['limit_response_size'] ) {
+ $this_block_size = ( $parsed_args['limit_response_size'] - $bytes_written );
$block = substr( $block, 0, $this_block_size );
}
@@ -292,7 +292,7 @@ class WP_Http_Streams {
$bytes_written += $bytes_written_to_file;
- $keep_reading = ! isset( $r['limit_response_size'] ) || $bytes_written < $r['limit_response_size'];
+ $keep_reading = ! isset( $parsed_args['limit_response_size'] ) || $bytes_written < $parsed_args['limit_response_size'];
}
fclose( $stream_handle );
@@ -306,7 +306,7 @@ class WP_Http_Streams {
$header_length = strpos( $strResponse, "\r\n\r\n" ) + 4;
$bodyStarted = true;
}
- $keep_reading = ( ! $bodyStarted || ! isset( $r['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $r['limit_response_size'] ) );
+ $keep_reading = ( ! $bodyStarted || ! isset( $parsed_args['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $parsed_args['limit_response_size'] ) );
}
$process = WP_Http::processResponse( $strResponse );
@@ -324,11 +324,11 @@ class WP_Http_Streams {
'body' => null,
'response' => $arrHeaders['response'],
'cookies' => $arrHeaders['cookies'],
- 'filename' => $r['filename'],
+ 'filename' => $parsed_args['filename'],
);
// Handle redirects.
- $redirect_response = WP_Http::handle_redirects( $url, $r, $response );
+ $redirect_response = WP_Http::handle_redirects( $url, $parsed_args, $response );
if ( false !== $redirect_response ) {
return $redirect_response;
}
@@ -338,12 +338,12 @@ class WP_Http_Streams {
$process['body'] = WP_Http::chunkTransferDecode( $process['body'] );
}
- if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode( $arrHeaders['headers'] ) ) {
+ if ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $arrHeaders['headers'] ) ) {
$process['body'] = WP_Http_Encoding::decompress( $process['body'] );
}
- if ( isset( $r['limit_response_size'] ) && strlen( $process['body'] ) > $r['limit_response_size'] ) {
- $process['body'] = substr( $process['body'], 0, $r['limit_response_size'] );
+ if ( isset( $parsed_args['limit_response_size'] ) && strlen( $process['body'] ) > $parsed_args['limit_response_size'] ) {
+ $process['body'] = substr( $process['body'], 0, $parsed_args['limit_response_size'] );
}
$response['body'] = $process['body'];
diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php
index 95fed66943..bf8cbcce16 100644
--- a/wp-includes/comment-template.php
+++ b/wp-includes/comment-template.php
@@ -2014,7 +2014,7 @@ function wp_list_comments( $args = array(), $comments = null ) {
'echo' => true,
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
/**
* Filters the arguments used in retrieving the comment list.
@@ -2023,9 +2023,9 @@ function wp_list_comments( $args = array(), $comments = null ) {
*
* @see wp_list_comments()
*
- * @param array $r An array of arguments for displaying comments.
+ * @param array $parsed_args An array of arguments for displaying comments.
*/
- $r = apply_filters( 'wp_list_comments_args', $r );
+ $parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args );
// Figure out what comments we'll be looping through ($_comments)
if ( null !== $comments ) {
@@ -2033,12 +2033,12 @@ function wp_list_comments( $args = array(), $comments = null ) {
if ( empty( $comments ) ) {
return;
}
- if ( 'all' != $r['type'] ) {
+ if ( 'all' != $parsed_args['type'] ) {
$comments_by_type = separate_comments( $comments );
- if ( empty( $comments_by_type[ $r['type'] ] ) ) {
+ if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {
return;
}
- $_comments = $comments_by_type[ $r['type'] ];
+ $_comments = $comments_by_type[ $parsed_args['type'] ];
} else {
$_comments = $comments;
}
@@ -2047,14 +2047,14 @@ function wp_list_comments( $args = array(), $comments = null ) {
* If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,
* perform a separate comment query and allow Walker_Comment to paginate.
*/
- if ( $r['page'] || $r['per_page'] ) {
+ if ( $parsed_args['page'] || $parsed_args['per_page'] ) {
$current_cpage = get_query_var( 'cpage' );
if ( ! $current_cpage ) {
$current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;
}
$current_per_page = get_query_var( 'comments_per_page' );
- if ( $r['page'] != $current_cpage || $r['per_page'] != $current_per_page ) {
+ if ( $parsed_args['page'] != $current_cpage || $parsed_args['per_page'] != $current_per_page ) {
$comment_args = array(
'post_id' => get_the_ID(),
'orderby' => 'comment_date_gmt',
@@ -2074,13 +2074,13 @@ function wp_list_comments( $args = array(), $comments = null ) {
$comments = get_comments( $comment_args );
- if ( 'all' != $r['type'] ) {
+ if ( 'all' != $parsed_args['type'] ) {
$comments_by_type = separate_comments( $comments );
- if ( empty( $comments_by_type[ $r['type'] ] ) ) {
+ if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {
return;
}
- $_comments = $comments_by_type[ $r['type'] ];
+ $_comments = $comments_by_type[ $parsed_args['type'] ];
} else {
$_comments = $comments;
}
@@ -2091,14 +2091,14 @@ function wp_list_comments( $args = array(), $comments = null ) {
if ( empty( $wp_query->comments ) ) {
return;
}
- if ( 'all' != $r['type'] ) {
+ if ( 'all' != $parsed_args['type'] ) {
if ( empty( $wp_query->comments_by_type ) ) {
$wp_query->comments_by_type = separate_comments( $wp_query->comments );
}
- if ( empty( $wp_query->comments_by_type[ $r['type'] ] ) ) {
+ if ( empty( $wp_query->comments_by_type[ $parsed_args['type'] ] ) ) {
return;
}
- $_comments = $wp_query->comments_by_type[ $r['type'] ];
+ $_comments = $wp_query->comments_by_type[ $parsed_args['type'] ];
} else {
$_comments = $wp_query->comments;
}
@@ -2107,73 +2107,73 @@ function wp_list_comments( $args = array(), $comments = null ) {
$default_comments_page = get_option( 'default_comments_page' );
$cpage = get_query_var( 'cpage' );
if ( 'newest' === $default_comments_page ) {
- $r['cpage'] = $cpage;
+ $parsed_args['cpage'] = $cpage;
/*
* When first page shows oldest comments, post permalink is the same as
* the comment permalink.
*/
} elseif ( $cpage == 1 ) {
- $r['cpage'] = '';
+ $parsed_args['cpage'] = '';
} else {
- $r['cpage'] = $cpage;
+ $parsed_args['cpage'] = $cpage;
}
- $r['page'] = 0;
- $r['per_page'] = 0;
+ $parsed_args['page'] = 0;
+ $parsed_args['per_page'] = 0;
}
}
}
- if ( '' === $r['per_page'] && get_option( 'page_comments' ) ) {
- $r['per_page'] = get_query_var( 'comments_per_page' );
+ if ( '' === $parsed_args['per_page'] && get_option( 'page_comments' ) ) {
+ $parsed_args['per_page'] = get_query_var( 'comments_per_page' );
}
- if ( empty( $r['per_page'] ) ) {
- $r['per_page'] = 0;
- $r['page'] = 0;
+ if ( empty( $parsed_args['per_page'] ) ) {
+ $parsed_args['per_page'] = 0;
+ $parsed_args['page'] = 0;
}
- if ( '' === $r['max_depth'] ) {
+ if ( '' === $parsed_args['max_depth'] ) {
if ( get_option( 'thread_comments' ) ) {
- $r['max_depth'] = get_option( 'thread_comments_depth' );
+ $parsed_args['max_depth'] = get_option( 'thread_comments_depth' );
} else {
- $r['max_depth'] = -1;
+ $parsed_args['max_depth'] = -1;
}
}
- if ( '' === $r['page'] ) {
+ if ( '' === $parsed_args['page'] ) {
if ( empty( $overridden_cpage ) ) {
- $r['page'] = get_query_var( 'cpage' );
+ $parsed_args['page'] = get_query_var( 'cpage' );
} else {
- $threaded = ( -1 != $r['max_depth'] );
- $r['page'] = ( 'newest' == get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $r['per_page'], $threaded ) : 1;
- set_query_var( 'cpage', $r['page'] );
+ $threaded = ( -1 != $parsed_args['max_depth'] );
+ $parsed_args['page'] = ( 'newest' == get_option( 'default_comments_page' ) ) ? get_comment_pages_count( $_comments, $parsed_args['per_page'], $threaded ) : 1;
+ set_query_var( 'cpage', $parsed_args['page'] );
}
}
// Validation check
- $r['page'] = intval( $r['page'] );
- if ( 0 == $r['page'] && 0 != $r['per_page'] ) {
- $r['page'] = 1;
+ $parsed_args['page'] = intval( $parsed_args['page'] );
+ if ( 0 == $parsed_args['page'] && 0 != $parsed_args['per_page'] ) {
+ $parsed_args['page'] = 1;
}
- if ( null === $r['reverse_top_level'] ) {
- $r['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );
+ if ( null === $parsed_args['reverse_top_level'] ) {
+ $parsed_args['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );
}
wp_queue_comments_for_comment_meta_lazyload( $_comments );
- if ( empty( $r['walker'] ) ) {
+ if ( empty( $parsed_args['walker'] ) ) {
$walker = new Walker_Comment;
} else {
- $walker = $r['walker'];
+ $walker = $parsed_args['walker'];
}
- $output = $walker->paged_walk( $_comments, $r['max_depth'], $r['page'], $r['per_page'], $r );
+ $output = $walker->paged_walk( $_comments, $parsed_args['max_depth'], $parsed_args['page'], $parsed_args['per_page'], $parsed_args );
$in_comment_loop = false;
- if ( $r['echo'] ) {
+ if ( $parsed_args['echo'] ) {
echo $output;
} else {
return $output;
diff --git a/wp-includes/comment.php b/wp-includes/comment.php
index 6cd0eb4610..3ac8b3f763 100644
--- a/wp-includes/comment.php
+++ b/wp-includes/comment.php
@@ -164,15 +164,15 @@ function get_approved_comments( $post_id, $args = array() ) {
return array();
}
- $defaults = array(
+ $defaults = array(
'status' => 1,
'post_id' => $post_id,
'order' => 'ASC',
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
$query = new WP_Comment_Query;
- return $query->query( $r );
+ return $query->query( $parsed_args );
}
/**
diff --git a/wp-includes/deprecated.php b/wp-includes/deprecated.php
index 677a9b5d44..387524f80e 100644
--- a/wp-includes/deprecated.php
+++ b/wp-includes/deprecated.php
@@ -430,9 +430,9 @@ function wp_get_linksbyname($category, $args = '') {
'title_li' => '',
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
- return wp_list_bookmarks($r);
+ return wp_list_bookmarks($parsed_args);
}
/**
@@ -635,24 +635,24 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
function wp_list_cats($args = '') {
_deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );
- $r = wp_parse_args( $args );
+ $parsed_args = wp_parse_args( $args );
// Map to new names.
- if ( isset($r['optionall']) && isset($r['all']))
- $r['show_option_all'] = $r['all'];
- if ( isset($r['sort_column']) )
- $r['orderby'] = $r['sort_column'];
- if ( isset($r['sort_order']) )
- $r['order'] = $r['sort_order'];
- if ( isset($r['optiondates']) )
- $r['show_last_update'] = $r['optiondates'];
- if ( isset($r['optioncount']) )
- $r['show_count'] = $r['optioncount'];
- if ( isset($r['list']) )
- $r['style'] = $r['list'] ? 'list' : 'break';
- $r['title_li'] = '';
+ if ( isset($parsed_args['optionall']) && isset($parsed_args['all']))
+ $parsed_args['show_option_all'] = $parsed_args['all'];
+ if ( isset($parsed_args['sort_column']) )
+ $parsed_args['orderby'] = $parsed_args['sort_column'];
+ if ( isset($parsed_args['sort_order']) )
+ $parsed_args['order'] = $parsed_args['sort_order'];
+ if ( isset($parsed_args['optiondates']) )
+ $parsed_args['show_last_update'] = $parsed_args['optiondates'];
+ if ( isset($parsed_args['optioncount']) )
+ $parsed_args['show_count'] = $parsed_args['optioncount'];
+ if ( isset($parsed_args['list']) )
+ $parsed_args['style'] = $parsed_args['list'] ? 'list' : 'break';
+ $parsed_args['title_li'] = '';
- return wp_list_categories($r);
+ return wp_list_categories($parsed_args);
}
/**
@@ -892,9 +892,9 @@ function wp_get_links($args = '') {
'title_li' => '',
);
- $r = wp_parse_args( $args, $defaults );
+ $parsed_args = wp_parse_args( $args, $defaults );
- return wp_list_bookmarks($r);
+ return wp_list_bookmarks($parsed_args);
}
/**
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index a66b3fa406..5a3447f517 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -3080,13 +3080,13 @@ function wp_die( $message = '', $title = '', $args = array() ) {
* @param string|array $args Optional. Arguments to control behavior. Default empty array.
*/
function _default_wp_die_handler( $message, $title = '', $args = array() ) {
- list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
+ list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
if ( is_string( $message ) ) {
- if ( ! empty( $r['additional_errors'] ) ) {
+ if ( ! empty( $parsed_args['additional_errors'] ) ) {
$message = array_merge(
array( $message ),
- wp_list_pluck( $r['additional_errors'], 'message' )
+ wp_list_pluck( $parsed_args['additional_errors'], 'message' )
);
$message = "\n\t\t- " . join( "
\n\t\t- ", $message ) . "
\n\t ";
} else {
@@ -3096,16 +3096,16 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) {
$have_gettext = function_exists( '__' );
- if ( ! empty( $r['link_url'] ) && ! empty( $r['link_text'] ) ) {
- $link_url = $r['link_url'];
+ if ( ! empty( $parsed_args['link_url'] ) && ! empty( $parsed_args['link_text'] ) ) {
+ $link_url = $parsed_args['link_url'];
if ( function_exists( 'esc_url' ) ) {
$link_url = esc_url( $link_url );
}
- $link_text = $r['link_text'];
+ $link_text = $parsed_args['link_text'];
$message .= "\n{$link_text} ";
}
- if ( isset( $r['back_link'] ) && $r['back_link'] ) {
+ if ( isset( $parsed_args['back_link'] ) && $parsed_args['back_link'] ) {
$back_text = $have_gettext ? __( '« Back' ) : '« Back';
$message .= "\n$back_text ";
}
@@ -3113,11 +3113,11 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) {
if ( ! did_action( 'admin_head' ) ) :
if ( ! headers_sent() ) {
header( 'Content-Type: text/html; charset=utf-8' );
- status_header( $r['response'] );
+ status_header( $parsed_args['response'] );
nocache_headers();
}
- $text_direction = $r['text_direction'];
+ $text_direction = $parsed_args['text_direction'];
if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) {
$dir_attr = get_language_attributes();
} else {
@@ -3258,7 +3258,7 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) {
|