<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[45667] trunk/src: Coding Standards: Rename `$r` variable used with `wp_parse_args()` to `$parsed_args` for clarity.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/45667">45667</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/45667","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>SergeyBiryukov</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2019-07-25 00:47:53 +0000 (Thu, 25 Jul 2019)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Coding Standards: Rename `$r` variable used with `wp_parse_args()` to `$parsed_args` for clarity.
Props freewebmentor.
Fixes <a href="https://core.trac.wordpress.org/ticket/45059">#45059</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminincludesbookmarkphp">trunk/src/wp-admin/includes/bookmark.php</a></li>
<li><a href="#trunksrcwpadminincludesmediaphp">trunk/src/wp-admin/includes/media.php</a></li>
<li><a href="#trunksrcwpadminincludesmetaboxesphp">trunk/src/wp-admin/includes/meta-boxes.php</a></li>
<li><a href="#trunksrcwpadminincludesmsphp">trunk/src/wp-admin/includes/ms.php</a></li>
<li><a href="#trunksrcwpadminincludestemplatephp">trunk/src/wp-admin/includes/template.php</a></li>
<li><a href="#trunksrcwpincludesbookmarktemplatephp">trunk/src/wp-includes/bookmark-template.php</a></li>
<li><a href="#trunksrcwpincludesbookmarkphp">trunk/src/wp-includes/bookmark.php</a></li>
<li><a href="#trunksrcwpincludescategorytemplatephp">trunk/src/wp-includes/category-template.php</a></li>
<li><a href="#trunksrcwpincludesclasshttpphp">trunk/src/wp-includes/class-http.php</a></li>
<li><a href="#trunksrcwpincludesclasswpajaxresponsephp">trunk/src/wp-includes/class-wp-ajax-response.php</a></li>
<li><a href="#trunksrcwpincludesclasswphttpcurlphp">trunk/src/wp-includes/class-wp-http-curl.php</a></li>
<li><a href="#trunksrcwpincludesclasswphttpstreamsphp">trunk/src/wp-includes/class-wp-http-streams.php</a></li>
<li><a href="#trunksrcwpincludescommenttemplatephp">trunk/src/wp-includes/comment-template.php</a></li>
<li><a href="#trunksrcwpincludescommentphp">trunk/src/wp-includes/comment.php</a></li>
<li><a href="#trunksrcwpincludesdeprecatedphp">trunk/src/wp-includes/deprecated.php</a></li>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
<li><a href="#trunksrcwpincludesgeneraltemplatephp">trunk/src/wp-includes/general-template.php</a></li>
<li><a href="#trunksrcwpincludesposttemplatephp">trunk/src/wp-includes/post-template.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludestaxonomyphp">trunk/src/wp-includes/taxonomy.php</a></li>
<li><a href="#trunksrcwpincludesuserphp">trunk/src/wp-includes/user.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminincludesbookmarkphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/bookmark.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/bookmark.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-admin/includes/bookmark.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -162,12 +162,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'link_rating' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $args = wp_parse_args( $linkdata, $defaults );
- $r = wp_unslash( sanitize_bookmark( $args, 'db' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $linkdata, $defaults );
+ $parsed_args = wp_unslash( sanitize_bookmark( $parsed_args, 'db' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link_id = $r['link_id'];
- $link_name = $r['link_name'];
- $link_url = $r['link_url'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $link_id = $parsed_args['link_id'];
+ $link_name = $parsed_args['link_name'];
+ $link_url = $parsed_args['link_url'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $update = false;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $link_id ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -186,16 +186,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link_rating = ( ! empty( $r['link_rating'] ) ) ? $r['link_rating'] : 0;
- $link_image = ( ! empty( $r['link_image'] ) ) ? $r['link_image'] : '';
- $link_target = ( ! empty( $r['link_target'] ) ) ? $r['link_target'] : '';
- $link_visible = ( ! empty( $r['link_visible'] ) ) ? $r['link_visible'] : 'Y';
- $link_owner = ( ! empty( $r['link_owner'] ) ) ? $r['link_owner'] : get_current_user_id();
- $link_notes = ( ! empty( $r['link_notes'] ) ) ? $r['link_notes'] : '';
- $link_description = ( ! empty( $r['link_description'] ) ) ? $r['link_description'] : '';
- $link_rss = ( ! empty( $r['link_rss'] ) ) ? $r['link_rss'] : '';
- $link_rel = ( ! empty( $r['link_rel'] ) ) ? $r['link_rel'] : '';
- $link_category = ( ! empty( $r['link_category'] ) ) ? $r['link_category'] : array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $link_rating = ( ! empty( $parsed_args['link_rating'] ) ) ? $parsed_args['link_rating'] : 0;
+ $link_image = ( ! empty( $parsed_args['link_image'] ) ) ? $parsed_args['link_image'] : '';
+ $link_target = ( ! empty( $parsed_args['link_target'] ) ) ? $parsed_args['link_target'] : '';
+ $link_visible = ( ! empty( $parsed_args['link_visible'] ) ) ? $parsed_args['link_visible'] : 'Y';
+ $link_owner = ( ! empty( $parsed_args['link_owner'] ) ) ? $parsed_args['link_owner'] : get_current_user_id();
+ $link_notes = ( ! empty( $parsed_args['link_notes'] ) ) ? $parsed_args['link_notes'] : '';
+ $link_description = ( ! empty( $parsed_args['link_description'] ) ) ? $parsed_args['link_description'] : '';
+ $link_rss = ( ! empty( $parsed_args['link_rss'] ) ) ? $parsed_args['link_rss'] : '';
+ $link_rel = ( ! empty( $parsed_args['link_rel'] ) ) ? $parsed_args['link_rel'] : '';
+ $link_category = ( ! empty( $parsed_args['link_category'] ) ) ? $parsed_args['link_category'] : array();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure we set a valid category.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_array( $link_category ) || 0 == count( $link_category ) ) {
</span></span></pre></div>
<a id="trunksrcwpadminincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/media.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-admin/includes/media.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1493,8 +1493,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'toggle' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'show_title' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $args = wp_parse_args( $args, $default_args );
</del><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $default_args );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the arguments used to retrieve an image for the edit image form.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1502,9 +1503,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_media_item
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $args An array of arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args An array of arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = apply_filters( 'get_media_item_args', $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = apply_filters( 'get_media_item_args', $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $toggle_on = __( 'Show' );
</span><span class="cx" style="display: block; padding: 0 10px"> $toggle_off = __( 'Hide' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1518,10 +1519,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $type = reset( $keys );
</span><span class="cx" style="display: block; padding: 0 10px"> $type_html = "<input type='hidden' id='type-of-$attachment_id' value='" . esc_attr( $type ) . "' />";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $form_fields = get_attachment_fields_to_edit( $post, $r['errors'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $form_fields = get_attachment_fields_to_edit( $post, $parsed_args['errors'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['toggle'] ) {
- $class = empty( $r['errors'] ) ? 'startclosed' : 'startopen';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['toggle'] ) {
+ $class = empty( $parsed_args['errors'] ) ? 'startclosed' : 'startopen';
</ins><span class="cx" style="display: block; padding: 0 10px"> $toggle_links = "
</span><span class="cx" style="display: block; padding: 0 10px"> <a class='toggle describe-toggle-on' href='#'>$toggle_on</a>
</span><span class="cx" style="display: block; padding: 0 10px"> <a class='toggle describe-toggle-off' href='#'>$toggle_off</a>";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1531,7 +1532,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $display_title = ( ! empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $display_title = $r['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . '</span></div>' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $display_title = $parsed_args['show_title'] ? "<div class='filename new'><span class='title'>" . wp_html_excerpt( $display_title, 60, '…' ) . '</span></div>' : '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $gallery = ( ( isset( $_REQUEST['tab'] ) && 'gallery' == $_REQUEST['tab'] ) || ( isset( $redir_tab ) && 'gallery' == $redir_tab ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $order = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1609,11 +1610,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'extra_rows' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['send'] ) {
- $r['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['send'] ) {
+ $parsed_args['send'] = get_submit_button( __( 'Insert into Post' ), '', "send[$attachment_id]", false );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $delete = empty( $r['delete'] ) ? '' : $r['delete'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $delete = empty( $parsed_args['delete'] ) ? '' : $parsed_args['delete'];
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! EMPTY_TRASH_DAYS ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $delete = "<a href='" . wp_nonce_url( "post.php?action=delete&post=$attachment_id", 'delete-post_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete-permanently'>" . __( 'Delete Permanently' ) . '</a>';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1650,8 +1651,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html( $calling_post_type_object->labels->use_featured_image ) . '</a>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ( $r['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) {
- $form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>" . $r['send'] . " $thumbnail $delete</td></tr>\n" );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ( $parsed_args['send'] || $thumbnail || $delete ) && ! isset( $form_fields['buttons'] ) ) {
+ $form_fields['buttons'] = array( 'tr' => "\t\t<tr class='submit'><td></td><td class='savesend'>" . $parsed_args['send'] . " $thumbnail $delete</td></tr>\n" );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $hidden_fields = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminincludesmetaboxesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/meta-boxes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/meta-boxes.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-admin/includes/meta-boxes.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -492,9 +492,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $box['args'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
- $tax_name = esc_attr( $r['taxonomy'] );
- $taxonomy = get_taxonomy( $r['taxonomy'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
+ $tax_name = esc_attr( $parsed_args['taxonomy'] );
+ $taxonomy = get_taxonomy( $parsed_args['taxonomy'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $user_can_assign_terms = current_user_can( $taxonomy->cap->assign_terms );
</span><span class="cx" style="display: block; padding: 0 10px"> $comma = _x( ',', 'tag delimiter' );
</span><span class="cx" style="display: block; padding: 0 10px"> $terms_to_edit = get_terms_to_edit( $post->ID, $tax_name );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -555,9 +555,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $args = $box['args'];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
- $tax_name = esc_attr( $r['taxonomy'] );
- $taxonomy = get_taxonomy( $r['taxonomy'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
+ $tax_name = esc_attr( $parsed_args['taxonomy'] );
+ $taxonomy = get_taxonomy( $parsed_args['taxonomy'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="taxonomy-<?php echo $tax_name; ?>" class="categorydiv">
</span><span class="cx" style="display: block; padding: 0 10px"> <ul id="<?php echo $tax_name; ?>-tabs" class="category-tabs">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1310,12 +1310,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <th scope="row"><label for="link_rating"><?php _e( 'Rating' ); ?></label></th>
</span><span class="cx" style="display: block; padding: 0 10px"> <td><select name="link_rating" id="link_rating" size="1">
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- for ( $r = 0; $r <= 10; $r++ ) {
- echo '<option value="' . $r . '"';
- if ( isset( $link->link_rating ) && $link->link_rating == $r ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ for ( $parsed_args = 0; $parsed_args <= 10; $parsed_args++ ) {
+ echo '<option value="' . $parsed_args . '"';
+ if ( isset( $link->link_rating ) && $link->link_rating == $parsed_args ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo ' selected="selected"';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo( '>' . $r . '</option>' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo( '>' . $parsed_args . '</option>' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> ?>
</span><span class="cx" style="display: block; padding: 0 10px"> </select> <?php _e( '(Leave at 0 for no rating.)' ); ?>
</span></span></pre></div>
<a id="trunksrcwpadminincludesmsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/ms.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/ms.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-admin/includes/ms.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1089,7 +1089,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Parse arguments
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args(
</ins><span class="cx" style="display: block; padding: 0 10px"> $args,
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'blog_id' => isset( $_GET['blog_id'] ) ? (int) $_GET['blog_id'] : 0,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1102,10 +1102,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $screen_links = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Loop through tabs
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $r['links'] as $link_id => $link ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $parsed_args['links'] as $link_id => $link ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Skip link if user can't access
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! current_user_can( $link['cap'], $r['blog_id'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! current_user_can( $link['cap'], $parsed_args['blog_id'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1116,7 +1116,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $aria_current = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Selected is set by the parent OR assumed by the $pagenow global
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['selected'] === $link_id || $link['url'] === $GLOBALS['pagenow'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $classes[] = 'nav-tab-active';
</span><span class="cx" style="display: block; padding: 0 10px"> $aria_current = ' aria-current="page"';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1125,7 +1125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $esc_classes = implode( ' ', $classes );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Get the URL for this link
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $url = add_query_arg( array( 'id' => $r['blog_id'] ), network_admin_url( $link['url'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $url = add_query_arg( array( 'id' => $parsed_args['blog_id'] ), network_admin_url( $link['url'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add link to nav links
</span><span class="cx" style="display: block; padding: 0 10px"> $screen_links[ $link_id ] = '<a href="' . esc_url( $url ) . '" id="' . esc_attr( $link_id ) . '" class="' . $esc_classes . '"' . $aria_current . '>' . esc_html( $link['label'] ) . '</a>';
</span></span></pre></div>
<a id="trunksrcwpadminincludestemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/template.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-admin/includes/template.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -100,16 +100,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $params = apply_filters( 'wp_terms_checklist_args', $args, $post_id );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $params, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $params, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $r['walker'] ) || ! ( $r['walker'] instanceof Walker ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $parsed_args['walker'] ) || ! ( $parsed_args['walker'] instanceof Walker ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $walker = new Walker_Category_Checklist;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $walker = $r['walker'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $walker = $parsed_args['walker'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $taxonomy = $r['taxonomy'];
- $descendants_and_self = (int) $r['descendants_and_self'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $taxonomy = $parsed_args['taxonomy'];
+ $descendants_and_self = (int) $parsed_args['descendants_and_self'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $args = array( 'taxonomy' => $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -116,17 +116,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $tax = get_taxonomy( $taxonomy );
</span><span class="cx" style="display: block; padding: 0 10px"> $args['disabled'] = ! current_user_can( $tax->cap->assign_terms );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $args['list_only'] = ! empty( $r['list_only'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $args['list_only'] = ! empty( $parsed_args['list_only'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_array( $r['selected_cats'] ) ) {
- $args['selected_cats'] = $r['selected_cats'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_array( $parsed_args['selected_cats'] ) ) {
+ $args['selected_cats'] = $parsed_args['selected_cats'];
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $post_id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $args['selected_cats'] = wp_get_object_terms( $post_id, $taxonomy, array_merge( $args, array( 'fields' => 'ids' ) ) );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $args['selected_cats'] = array();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_array( $r['popular_cats'] ) ) {
- $args['popular_cats'] = $r['popular_cats'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_array( $parsed_args['popular_cats'] ) ) {
+ $args['popular_cats'] = $parsed_args['popular_cats'];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $args['popular_cats'] = get_terms(
</span><span class="cx" style="display: block; padding: 0 10px"> $taxonomy,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -156,7 +156,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['checked_ontop'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['checked_ontop'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // 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)
</span><span class="cx" style="display: block; padding: 0 10px"> $checked_categories = array();
</span><span class="cx" style="display: block; padding: 0 10px"> $keys = array_keys( $categories );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,7 +174,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Then the rest of them
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= call_user_func_array( array( $walker, 'walk' ), array( $categories, 0, $args ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $output;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2441,19 +2441,19 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string Star rating HTML.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_star_rating( $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $defaults = array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $defaults = array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'rating' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> 'type' => 'rating',
</span><span class="cx" style="display: block; padding: 0 10px"> 'number' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> 'echo' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Non-English decimal places when the $rating is coming from a string
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $rating = (float) str_replace( ',', '.', $r['rating'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $rating = (float) str_replace( ',', '.', $parsed_args['rating'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Convert Percentage to star rating, 0..5 in .5 increments
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'percent' === $r['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'percent' === $parsed_args['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $rating = round( $rating / 10, 0 ) / 2;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2462,10 +2462,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $half_stars = ceil( $rating - $full_stars );
</span><span class="cx" style="display: block; padding: 0 10px"> $empty_stars = 5 - $full_stars - $half_stars;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['number'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['number'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: the rating, 2: the number of ratings */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $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'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: the rating */
</span><span class="cx" style="display: block; padding: 0 10px"> $title = sprintf( __( '%s rating' ), number_format_i18n( $rating, 1 ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2478,7 +2478,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= str_repeat( '<div class="star star-empty" aria-hidden="true"></div>', $empty_stars );
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= '</div>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $output;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesbookmarktemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/bookmark-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/bookmark-template.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/bookmark-template.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -62,7 +62,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'link_after' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = ''; // Blank string to start with.
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,8 +70,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $bookmark->recently_updated ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $bookmark->recently_updated = false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['before'];
- if ( $r['show_updated'] && $bookmark->recently_updated ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['before'];
+ if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= '<em>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $the_link = '#';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -82,7 +82,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $name = esc_attr( sanitize_bookmark_field( 'link_name', $bookmark->link_name, $bookmark->link_id, 'display' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> $title = $desc;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_updated'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_updated'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( '00' != substr( $bookmark->link_updated_f, 0, 2 ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title .= ' (';
</span><span class="cx" style="display: block; padding: 0 10px"> $title .= sprintf(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -95,7 +95,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $title .= ')';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $alt = ' alt="' . $name . ( $r['show_description'] ? ' ' . $title : '' ) . '"';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $alt = ' alt="' . $name . ( $parsed_args['show_description'] ? ' ' . $title : '' ) . '"';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '' != $title ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $title = ' title="' . $title . '"';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -110,15 +110,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= '<a href="' . $the_link . '"' . $rel . $title . $target . '>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['link_before'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['link_before'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $bookmark->link_image != null && $r['show_images'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $bookmark->link_image != null && $parsed_args['show_images'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( strpos( $bookmark->link_image, 'http' ) === 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= "<img src=\"$bookmark->link_image\" $alt $title />";
</span><span class="cx" style="display: block; padding: 0 10px"> } else { // If it's a relative path
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= '<img src="' . get_option( 'siteurl' ) . "$bookmark->link_image\" $alt $title />";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_name'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_name'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= " $name";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -125,20 +125,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= $name;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['link_after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['link_after'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= '</a>';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_updated'] && $bookmark->recently_updated ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_updated'] && $bookmark->recently_updated ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= '</em>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_description'] && '' != $desc ) {
- $output .= $r['between'] . $desc;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_description'] && '' != $desc ) {
+ $output .= $parsed_args['between'] . $desc;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_rating'] ) {
- $output .= $r['between'] . sanitize_bookmark_field(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_rating'] ) {
+ $output .= $parsed_args['between'] . sanitize_bookmark_field(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'link_rating',
</span><span class="cx" style="display: block; padding: 0 10px"> $bookmark->link_rating,
</span><span class="cx" style="display: block; padding: 0 10px"> $bookmark->link_id,
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -145,7 +145,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'display'
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['after'] . "\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['after'] . "\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> } // end while
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -225,37 +225,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'category_after' => '</li>',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_array( $r['class'] ) ) {
- $r['class'] = explode( ' ', $r['class'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! is_array( $parsed_args['class'] ) ) {
+ $parsed_args['class'] = explode( ' ', $parsed_args['class'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['class'] = array_map( 'sanitize_html_class', $r['class'] );
- $r['class'] = trim( join( ' ', $r['class'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['class'] = array_map( 'sanitize_html_class', $parsed_args['class'] );
+ $parsed_args['class'] = trim( join( ' ', $parsed_args['class'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['categorize'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['categorize'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $cats = get_terms(
</span><span class="cx" style="display: block; padding: 0 10px"> 'link_category',
</span><span class="cx" style="display: block; padding: 0 10px"> array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name__like' => $r['category_name'],
- 'include' => $r['category'],
- 'exclude' => $r['exclude_category'],
- 'orderby' => $r['category_orderby'],
- 'order' => $r['category_order'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ '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'],
</ins><span class="cx" style="display: block; padding: 0 10px"> 'hierarchical' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $cats ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['categorize'] = false;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['categorize'] = false;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['categorize'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['categorize'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Split the bookmarks into ul's for each category
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $cats as $cat ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $params = array_merge( $r, array( 'category' => $cat->term_id ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $params = array_merge( $parsed_args, array( 'category' => $cat->term_id ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $bookmarks = get_bookmarks( $params );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $bookmarks ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -262,8 +262,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= str_replace(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '%id', '%class' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- array( "linkcat-$cat->term_id", $r['class'] ),
- $r['category_before']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ array( "linkcat-$cat->term_id", $parsed_args['class'] ),
+ $parsed_args['category_before']
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the category name.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,34 +274,34 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $catname = apply_filters( 'link_category', $cat->name );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['title_before'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['title_before'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= $catname;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['title_after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['title_after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\n\t<ul class='xoxo blogroll'>\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= _walk_bookmarks( $bookmarks, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= _walk_bookmarks( $bookmarks, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\n\t</ul>\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['category_after'] . "\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['category_after'] . "\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> //output one single list using title_li for the title
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $bookmarks = get_bookmarks( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $bookmarks = get_bookmarks( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $bookmarks ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['title_li'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['title_li'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= str_replace(
</span><span class="cx" style="display: block; padding: 0 10px"> array( '%id', '%class' ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- array( 'linkcat-' . $r['category'], $r['class'] ),
- $r['category_before']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ array( 'linkcat-' . $parsed_args['category'], $parsed_args['class'] ),
+ $parsed_args['category_before']
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['title_before'];
- $output .= $r['title_li'];
- $output .= $r['title_after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['title_before'];
+ $output .= $parsed_args['title_li'];
+ $output .= $parsed_args['title_after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\n\t<ul class='xoxo blogroll'>\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= _walk_bookmarks( $bookmarks, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= _walk_bookmarks( $bookmarks, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\n\t</ul>\n";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['category_after'] . "\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['category_after'] . "\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= _walk_bookmarks( $bookmarks, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= _walk_bookmarks( $bookmarks, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -315,7 +315,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $html = apply_filters( 'wp_list_bookmarks', $output );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $html;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> echo $html;
</span></span></pre></div>
<a id="trunksrcwpincludesbookmarkphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/bookmark.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/bookmark.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/bookmark.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -139,11 +139,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'search' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $key = md5( serialize( $r ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $key = md5( serialize( $parsed_args ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $cache = wp_cache_get( 'get_bookmarks', 'bookmark' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'rand' !== $r['orderby'] && $cache ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( 'rand' !== $parsed_args['orderby'] && $cache ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $cache ) && isset( $cache[ $key ] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $bookmarks = $cache[ $key ];
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -159,9 +160,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @see get_bookmarks()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $bookmarks List of the cached bookmarks.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r An array of bookmark query arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args An array of bookmark query arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'get_bookmarks', $bookmarks, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'get_bookmarks', $bookmarks, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -170,11 +171,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $inclusions = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 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'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( count( $inclinks ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $inclinks as $inclink ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $inclusions ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -190,8 +192,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $exclusions = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['exclude'] ) ) {
- $exlinks = wp_parse_id_list( $r['exclude'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['exclude'] ) ) {
+ $exlinks = wp_parse_id_list( $parsed_args['exclude'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( count( $exlinks ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $exlinks as $exlink ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $exclusions ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -206,28 +208,28 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $exclusions .= ')';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 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;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $cache[ $key ] = array();
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/bookmark.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'get_bookmarks', array(), $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'get_bookmarks', array(), $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $search = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['search'] ) ) {
- $like = '%' . $wpdb->esc_like( $r['search'] ) . '%';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['search'] ) ) {
+ $like = '%' . $wpdb->esc_like( $parsed_args['search'] ) . '%';
</ins><span class="cx" style="display: block; padding: 0 10px"> $search = $wpdb->prepare( ' AND ( (link_url LIKE %s) OR (link_name LIKE %s) OR (link_description LIKE %s) ) ', $like, $like, $like );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $category_query = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $join = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['category'] ) ) {
- $incategories = wp_parse_id_list( $r['category'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['category'] ) ) {
+ $incategories = wp_parse_id_list( $parsed_args['category'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( count( $incategories ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $incategories as $incat ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $category_query ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -243,15 +245,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $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";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_updated'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_updated'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $recently_updated_test = ', IF (DATE_ADD(link_updated, INTERVAL 120 MINUTE) >= NOW(), 1,0) as recently_updated ';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $recently_updated_test = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $get_updated = ( $r['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $get_updated = ( $parsed_args['show_updated'] ) ? ', UNIX_TIMESTAMP(link_updated) AS link_updated_f ' : '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $orderby = strtolower( $r['orderby'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $orderby = strtolower( $parsed_args['orderby'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $length = '';
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $orderby ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'length':
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -282,13 +284,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $orderby = 'link_name';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $order = strtoupper( $r['order'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $order = strtoupper( $parsed_args['order'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( '' !== $order && ! in_array( $order, array( 'ASC', 'DESC' ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $order = 'ASC';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $visible = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['hide_invisible'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['hide_invisible'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $visible = "AND link_visible = 'Y'";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -295,8 +297,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $query = "SELECT * $length $recently_updated_test $get_updated FROM $wpdb->links $join WHERE 1=1 $visible $category_query";
</span><span class="cx" style="display: block; padding: 0 10px"> $query .= " $exclusions $inclusions $search";
</span><span class="cx" style="display: block; padding: 0 10px"> $query .= " ORDER BY $orderby $order";
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['limit'] != -1 ) {
- $query .= ' LIMIT ' . $r['limit'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['limit'] != -1 ) {
+ $query .= ' LIMIT ' . $parsed_args['limit'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $results = $wpdb->get_results( $query );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -307,7 +309,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/bookmark.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'get_bookmarks', $results, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'get_bookmarks', $results, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludescategorytemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/category-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/category-template.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/category-template.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -365,14 +365,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $args['taxonomy'] = 'link_category';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
- $option_none_value = $r['option_none_value'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // 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'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
- $r['pad_counts'] = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {
+ $parsed_args['pad_counts'] = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $tab_index = $r['tab_index'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $tab_index = $parsed_args['tab_index'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $tab_index_attribute = '';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( (int) $tab_index > 0 ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -380,21 +381,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Avoid clashes with the 'name' param of get_terms().
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $get_terms_args = $r;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $get_terms_args = $parsed_args;
</ins><span class="cx" style="display: block; padding: 0 10px"> unset( $get_terms_args['name'] );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $categories = get_terms( $r['taxonomy'], $get_terms_args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $categories = get_terms( $parsed_args['taxonomy'], $get_terms_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $name = esc_attr( $r['name'] );
- $class = esc_attr( $r['class'] );
- $id = $r['id'] ? esc_attr( $r['id'] ) : $name;
- $required = $r['required'] ? 'required' : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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' : '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $r['hide_if_empty'] || ! empty( $categories ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output = "<select $required name='$name' id='$id' class='$class' $tab_index_attribute>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $categories ) && ! $r['hide_if_empty'] && ! empty( $r['show_option_none'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $categories ) && ! $parsed_args['hide_if_empty'] && ! empty( $parsed_args['show_option_none'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters a taxonomy drop-down display element.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -411,37 +412,37 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $element Category name.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param WP_Term|null $category The category object, or null if there's no corresponding category.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $show_option_none = apply_filters( 'list_cats', $parsed_args['show_option_none'], null );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\t<option value='" . esc_attr( $option_none_value ) . "' selected='selected'>$show_option_none</option>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $categories ) ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_option_all'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_option_all'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/category-template.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $show_option_all = apply_filters( 'list_cats', $r['show_option_all'], null );
- $selected = ( '0' === strval( $r['selected'] ) ) ? " selected='selected'" : '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $show_option_all = apply_filters( 'list_cats', $parsed_args['show_option_all'], null );
+ $selected = ( '0' === strval( $parsed_args['selected'] ) ) ? " selected='selected'" : '';
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\t<option value='0'$selected>$show_option_all</option>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_option_none'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_option_none'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/category-template.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $show_option_none = apply_filters( 'list_cats', $r['show_option_none'], null );
- $selected = selected( $option_none_value, $r['selected'], false );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $show_option_none = apply_filters( 'list_cats', $parsed_args['show_option_none'], null );
+ $selected = selected( $option_none_value, $parsed_args['selected'], false );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\t<option value='" . esc_attr( $option_none_value ) . "'$selected>$show_option_none</option>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['hierarchical'] ) {
- $depth = $r['depth']; // Walk the full depth.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['hierarchical'] ) {
+ $depth = $parsed_args['depth']; // Walk the full depth.
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $depth = -1; // Flat.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= walk_category_dropdown_tree( $categories, $depth, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= walk_category_dropdown_tree( $categories, $depth, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $r['hide_if_empty'] || ! empty( $categories ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $parsed_args['hide_if_empty'] || ! empty( $categories ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "</select>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -450,11 +451,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $output HTML output.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r Arguments used to build the drop-down.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args Arguments used to build the drop-down.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = apply_filters( 'wp_dropdown_cats', $output, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = apply_filters( 'wp_dropdown_cats', $output, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $output;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -537,48 +538,48 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'use_desc_for_title' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! isset( $r['pad_counts'] ) && $r['show_count'] && $r['hierarchical'] ) {
- $r['pad_counts'] = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! isset( $parsed_args['pad_counts'] ) && $parsed_args['show_count'] && $parsed_args['hierarchical'] ) {
+ $parsed_args['pad_counts'] = true;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Descendants of exclusions should be excluded too.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( true == $r['hierarchical'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true == $parsed_args['hierarchical'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $exclude_tree = array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exclude_tree'] ) {
- $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude_tree'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exclude_tree'] ) {
+ $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude_tree'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exclude'] ) {
- $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $r['exclude'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exclude'] ) {
+ $exclude_tree = array_merge( $exclude_tree, wp_parse_id_list( $parsed_args['exclude'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['exclude_tree'] = $exclude_tree;
- $r['exclude'] = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['exclude_tree'] = $exclude_tree;
+ $parsed_args['exclude'] = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! isset( $r['class'] ) ) {
- $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! isset( $parsed_args['class'] ) ) {
+ $parsed_args['class'] = ( 'category' == $parsed_args['taxonomy'] ) ? 'categories' : $parsed_args['taxonomy'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! taxonomy_exists( $r['taxonomy'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! taxonomy_exists( $parsed_args['taxonomy'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $show_option_all = $r['show_option_all'];
- $show_option_none = $r['show_option_none'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $show_option_all = $parsed_args['show_option_all'];
+ $show_option_none = $parsed_args['show_option_none'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $categories = get_categories( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $categories = get_categories( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) {
- $output = '<li class="' . esc_attr( $r['class'] ) . '">' . $r['title_li'] . '<ul>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['title_li'] && 'list' == $parsed_args['style'] && ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] ) ) {
+ $output = '<li class="' . esc_attr( $parsed_args['class'] ) . '">' . $parsed_args['title_li'] . '<ul>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $categories ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $show_option_none ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'list' == $r['style'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'list' == $parsed_args['style'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= '<li class="cat-item-none">' . $show_option_none . '</li>';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= $show_option_none;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -590,7 +591,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $posts_page = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // For taxonomies that belong only to custom post types, point to a valid archive.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $taxonomy_object = get_taxonomy( $r['taxonomy'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $taxonomy_object = get_taxonomy( $parsed_args['taxonomy'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( 'post', $taxonomy_object->object_type ) && ! in_array( 'page', $taxonomy_object->object_type ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $taxonomy_object->object_type as $object_type ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_object_type = get_post_type_object( $object_type );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -613,7 +614,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $posts_page = esc_url( $posts_page );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'list' == $r['style'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'list' == $parsed_args['style'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "<li class='cat-item-all'><a href='$posts_page'>$show_option_all</a></li>";
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= "<a href='$posts_page'>$show_option_all</a>";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -620,22 +621,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $r['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $parsed_args['current_category'] ) && ( is_category() || is_tax() || is_tag() ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $current_term_object = get_queried_object();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $current_term_object && $r['taxonomy'] === $current_term_object->taxonomy ) {
- $r['current_category'] = get_queried_object_id();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $current_term_object && $parsed_args['taxonomy'] === $current_term_object->taxonomy ) {
+ $parsed_args['current_category'] = get_queried_object_id();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['hierarchical'] ) {
- $depth = $r['depth'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['hierarchical'] ) {
+ $depth = $parsed_args['depth'];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $depth = -1; // Flat.
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= walk_category_tree( $categories, $depth, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= walk_category_tree( $categories, $depth, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['title_li'] && 'list' == $r['style'] && ( ! empty( $categories ) || ! $r['hide_title_if_empty'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['title_li'] && 'list' == $parsed_args['style'] && ( ! empty( $categories ) || ! $parsed_args['hide_title_if_empty'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= '</ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -649,7 +650,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $html = apply_filters( 'wp_list_categories', $output, $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $html;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return $html;
</span></span></pre></div>
<a id="trunksrcwpincludesclasshttpphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-http.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-http.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/class-http.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -220,20 +220,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $defaults['redirection'] = 0;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the arguments used in an HTTP request.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.7.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r An array of HTTP request arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args An array of HTTP request arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The request URL.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = apply_filters( 'http_request_args', $r, $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = apply_filters( 'http_request_args', $parsed_args, $url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // The transports decrement this, store a copy of the original value for loop purposes.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! isset( $r['_redirection'] ) ) {
- $r['_redirection'] = $r['redirection'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! isset( $parsed_args['_redirection'] ) ) {
+ $parsed_args['_redirection'] = $parsed_args['redirection'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -251,10 +251,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param false|array|WP_Error $preempt Whether to preempt an HTTP request's return value. Default false.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r HTTP request arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args HTTP request arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The request URL.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pre = apply_filters( 'pre_http_request', false, $r, $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pre = apply_filters( 'pre_http_request', false, $parsed_args, $url );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( false !== $pre ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $pre;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -261,7 +261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( function_exists( 'wp_kses_bad_protocol' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['reject_unsafe_urls'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['reject_unsafe_urls'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $url = wp_http_validate_url( $url );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $url ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -274,7 +274,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $url ) || empty( $arrURL['scheme'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = new WP_Error( 'http_request_failed', __( 'A valid URL was not provided.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-http.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> return $response;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -281,46 +281,46 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $this->block_request( $url ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $response = new WP_Error( 'http_request_not_executed', __( 'User has blocked requests through HTTP.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-http.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> return $response;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If we are streaming to a file but no filename was given drop it in the WP temp dir
</span><span class="cx" style="display: block; padding: 0 10px"> // and pick its name using the basename of the $url
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['stream'] ) {
- if ( empty( $r['filename'] ) ) {
- $r['filename'] = get_temp_dir() . basename( $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['stream'] ) {
+ if ( empty( $parsed_args['filename'] ) ) {
+ $parsed_args['filename'] = get_temp_dir() . basename( $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Force some settings if we are streaming to a file and check for existence and perms of destination directory
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['blocking'] = true;
- if ( ! wp_is_writable( dirname( $r['filename'] ) ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['blocking'] = true;
+ if ( ! wp_is_writable( dirname( $parsed_args['filename'] ) ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $response = new WP_Error( 'http_request_failed', __( 'Destination directory for file streaming does not exist or is not writable.' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> /** This action is documented in wp-includes/class-http.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> return $response;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_null( $r['headers'] ) ) {
- $r['headers'] = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_null( $parsed_args['headers'] ) ) {
+ $parsed_args['headers'] = array();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // WP allows passing in headers as a string, weirdly.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_array( $r['headers'] ) ) {
- $processedHeaders = WP_Http::processHeaders( $r['headers'] );
- $r['headers'] = $processedHeaders['headers'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! is_array( $parsed_args['headers'] ) ) {
+ $processedHeaders = WP_Http::processHeaders( $parsed_args['headers'] );
+ $parsed_args['headers'] = $processedHeaders['headers'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Setup arguments
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $headers = $r['headers'];
- $data = $r['body'];
- $type = $r['method'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $headers = $parsed_args['headers'];
+ $data = $parsed_args['body'];
+ $type = $parsed_args['method'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $options = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'timeout' => $r['timeout'],
- 'useragent' => $r['user-agent'],
- 'blocking' => $r['blocking'],
- 'hooks' => new WP_HTTP_Requests_Hooks( $url, $r ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'timeout' => $parsed_args['timeout'],
+ 'useragent' => $parsed_args['user-agent'],
+ 'blocking' => $parsed_args['blocking'],
+ 'hooks' => new WP_HTTP_Requests_Hooks( $url, $parsed_args ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Ensure redirects follow browser behaviour.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -327,35 +327,35 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'browser_redirect_compatibility' ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Validate redirected URLs.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( function_exists( 'wp_kses_bad_protocol' ) && $r['reject_unsafe_urls'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( function_exists( 'wp_kses_bad_protocol' ) && $parsed_args['reject_unsafe_urls'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $options['hooks']->register( 'requests.before_redirect', array( get_class(), 'validate_redirects' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['stream'] ) {
- $options['filename'] = $r['filename'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['stream'] ) {
+ $options['filename'] = $parsed_args['filename'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $r['redirection'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $parsed_args['redirection'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $options['follow_redirects'] = false;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $options['redirects'] = $r['redirection'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $options['redirects'] = $parsed_args['redirection'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Use byte limit, if we can
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $r['limit_response_size'] ) ) {
- $options['max_bytes'] = $r['limit_response_size'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $parsed_args['limit_response_size'] ) ) {
+ $options['max_bytes'] = $parsed_args['limit_response_size'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If we've got cookies, use and convert them to Requests_Cookie.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['cookies'] ) ) {
- $options['cookies'] = WP_Http::normalize_cookies( $r['cookies'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['cookies'] ) ) {
+ $options['cookies'] = WP_Http::normalize_cookies( $parsed_args['cookies'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // SSL certificate handling
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $r['sslverify'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $parsed_args['sslverify'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $options['verify'] = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $options['verifyname'] = false;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $options['verify'] = $r['sslcertificates'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $options['verify'] = $parsed_args['sslcertificates'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // All non-GET/HEAD requests should put the arguments in the form body.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -393,7 +393,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $requests_response = Requests::request( $url, $headers, $data, $type, $options );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Convert the response into an array
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $http_response = new WP_HTTP_Requests_Response( $requests_response, $r['filename'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $http_response = new WP_HTTP_Requests_Response( $requests_response, $parsed_args['filename'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> $response = $http_response->to_array();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Add the original object to the array.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -412,15 +412,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array|WP_Error $response HTTP response or WP_Error object.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $context Context under which the hook is fired.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $class HTTP transport used.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r HTTP request arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args HTTP request arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The request URL.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action( 'http_api_debug', $response, 'response', 'Requests', $r, $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action( 'http_api_debug', $response, 'response', 'Requests', $parsed_args, $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $response ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $response;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $r['blocking'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $parsed_args['blocking'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'body' => '',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -439,10 +439,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.9.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $response HTTP response.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r HTTP request arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args HTTP request arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The request URL.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'http_response', $response, $r, $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'http_response', $response, $parsed_args, $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -600,9 +600,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function post( $url, $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $defaults = array( 'method' => 'POST' );
- $r = wp_parse_args( $args, $defaults );
- return $this->request( $url, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $defaults = array( 'method' => 'POST' );
+ $parsed_args = wp_parse_args( $args, $defaults );
+ return $this->request( $url, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -617,9 +617,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function get( $url, $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $defaults = array( 'method' => 'GET' );
- $r = wp_parse_args( $args, $defaults );
- return $this->request( $url, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $defaults = array( 'method' => 'GET' );
+ $parsed_args = wp_parse_args( $args, $defaults );
+ return $this->request( $url, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -634,9 +634,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return array|WP_Error Array containing 'headers', 'body', 'response', 'cookies', 'filename'. A WP_Error instance upon error
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function head( $url, $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $defaults = array( 'method' => 'HEAD' );
- $r = wp_parse_args( $args, $defaults );
- return $this->request( $url, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $defaults = array( 'method' => 'HEAD' );
+ $parsed_args = wp_parse_args( $args, $defaults );
+ return $this->request( $url, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesclasswpajaxresponsephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-ajax-response.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-ajax-response.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/class-wp-ajax-response.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -73,14 +73,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'supplemental' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $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'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_wp_error( $id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $data = $id;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -118,8 +118,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $s = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_array( $r['supplemental'] ) ) {
- foreach ( $r['supplemental'] as $k => $v ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_array( $parsed_args['supplemental'] ) ) {
+ foreach ( $parsed_args['supplemental'] as $k => $v ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $s .= "<$k><![CDATA[$v]]></$k>";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $s = "<supplemental>$s</supplemental>";
</span></span></pre></div>
<a id="trunksrcwpincludesclasswphttpcurlphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-http-curl.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-http-curl.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/class-wp-http-curl.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -79,18 +79,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'cookies' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 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'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Construct Cookie: header if any cookies are set.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- WP_Http::buildCookieHeader( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ WP_Http::buildCookieHeader( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $handle = curl_init();
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -109,8 +109,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $is_local = isset( $r['local'] ) && $r['local'];
- $ssl_verify = isset( $r['sslverify'] ) && $r['sslverify'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $is_local = isset( $parsed_args['local'] ) && $parsed_args['local'];
+ $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $is_local ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/class-wp-http-streams.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $ssl_verify = apply_filters( 'https_local_ssl_verify', $ssl_verify, $url );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -123,7 +123,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers. Have to use ceil since.
</span><span class="cx" style="display: block; padding: 0 10px"> * a value of 0 will allow an unlimited timeout.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $timeout = (int) ceil( $r['timeout'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $timeout = (int) ceil( $parsed_args['timeout'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -133,10 +133,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_SSL_VERIFYPEER, $ssl_verify );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $ssl_verify ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- curl_setopt( $handle, CURLOPT_CAINFO, $r['sslcertificates'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ curl_setopt( $handle, CURLOPT_CAINFO, $parsed_args['sslcertificates'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- curl_setopt( $handle, CURLOPT_USERAGENT, $r['user-agent'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ curl_setopt( $handle, CURLOPT_USERAGENT, $parsed_args['user-agent'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * The option doesn't work with safe mode or when open_basedir is set, and there's
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -147,27 +147,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- switch ( $r['method'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ switch ( $parsed_args['method'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> case 'HEAD':
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_NOBODY, true );
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'POST':
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_POST, true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> case 'PUT':
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, 'PUT' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> default:
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $r['method'] );
- if ( ! is_null( $r['body'] ) ) {
- curl_setopt( $handle, CURLOPT_POSTFIELDS, $r['body'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ curl_setopt( $handle, CURLOPT_CUSTOMREQUEST, $parsed_args['method'] );
+ if ( ! is_null( $parsed_args['body'] ) ) {
+ curl_setopt( $handle, CURLOPT_POSTFIELDS, $parsed_args['body'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> break;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( true === $r['blocking'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true === $parsed_args['blocking'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_HEADERFUNCTION, array( $this, 'stream_headers' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_WRITEFUNCTION, array( $this, 'stream_body' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -174,18 +174,18 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_HEADER, false );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $r['limit_response_size'] ) ) {
- $this->max_body_length = intval( $r['limit_response_size'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $parsed_args['limit_response_size'] ) ) {
+ $this->max_body_length = intval( $parsed_args['limit_response_size'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->max_body_length = false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If streaming to a file open a file handle, and setup our curl streaming handler.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['stream'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['stream'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! WP_DEBUG ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->stream_handle = @fopen( $r['filename'], 'w+' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->stream_handle = @fopen( $parsed_args['filename'], 'w+' );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $this->stream_handle = fopen( $r['filename'], 'w+' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $this->stream_handle = fopen( $parsed_args['filename'], 'w+' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->stream_handle ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -194,7 +194,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: fopen(), 2: file name */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Could not open handle for %1$s to %2$s.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'fopen()',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['filename']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['filename']
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -202,16 +202,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $this->stream_handle = false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['headers'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['headers'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // cURL expects full header strings in each element.
</span><span class="cx" style="display: block; padding: 0 10px"> $headers = array();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( $r['headers'] as $name => $value ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( $parsed_args['headers'] as $name => $value ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $headers[] = "{$name}: $value";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_HTTPHEADER, $headers );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['httpversion'] == '1.0' ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['httpversion'] == '1.0' ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0 );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> curl_setopt( $handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1 );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -226,13 +226,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.8.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param resource $handle The cURL handle returned by curl_init() (passed by reference).
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r The HTTP request arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args The HTTP request arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $url The request URL.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- do_action_ref_array( 'http_api_curl', array( &$handle, $r, $url ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ do_action_ref_array( 'http_api_curl', array( &$handle, $parsed_args, $url ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // We don't need to return the body, so don't. Just execute request and return.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $r['blocking'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $parsed_args['blocking'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> curl_exec( $handle );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $curl_error = curl_error( $handle );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -272,7 +272,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $curl_error || ( 0 == strlen( $theBody ) && empty( $theHeaders['headers'] ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( CURLE_WRITE_ERROR /* 23 */ == $curl_error ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->max_body_length || $this->max_body_length != $bytes_written_total ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['stream'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['stream'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> curl_close( $handle );
</span><span class="cx" style="display: block; padding: 0 10px"> fclose( $this->stream_handle );
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error( 'http_request_failed', __( 'Failed to write request to temporary file.' ) );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -296,7 +296,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> curl_close( $handle );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['stream'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['stream'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> fclose( $this->stream_handle );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -305,16 +305,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'body' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => $theHeaders['response'],
</span><span class="cx" style="display: block; padding: 0 10px"> 'cookies' => $theHeaders['cookies'],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'filename' => $r['filename'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'filename' => $parsed_args['filename'],
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle redirects.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $redirect_response = WP_HTTP::handle_redirects( $url, $r, $response );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $redirect_response = WP_HTTP::handle_redirects( $url, $parsed_args, $response );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false !== $redirect_response ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $redirect_response;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $theHeaders['headers'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $theBody = WP_Http_Encoding::decompress( $theBody );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesclasswphttpstreamsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/class-wp-http-streams.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-http-streams.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/class-wp-http-streams.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,18 +38,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'cookies' => array(),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 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'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Construct Cookie: header if any cookies are set.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- WP_Http::buildCookieHeader( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ WP_Http::buildCookieHeader( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $arrURL = parse_url( $url );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -70,13 +70,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $arrURL['path'] = '/';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $r['headers']['Host'] ) || isset( $r['headers']['host'] ) ) {
- if ( isset( $r['headers']['Host'] ) ) {
- $arrURL['host'] = $r['headers']['Host'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $parsed_args['headers']['Host'] ) || isset( $parsed_args['headers']['host'] ) ) {
+ if ( isset( $parsed_args['headers']['Host'] ) ) {
+ $arrURL['host'] = $parsed_args['headers']['Host'];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $arrURL['host'] = $r['headers']['host'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $arrURL['host'] = $parsed_args['headers']['host'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- unset( $r['headers']['Host'], $r['headers']['host'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ unset( $parsed_args['headers']['Host'], $parsed_args['headers']['host'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -90,8 +90,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $connect_host = $secure_transport ? 'ssl://' . $connect_host : 'tcp://' . $connect_host;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $is_local = isset( $r['local'] ) && $r['local'];
- $ssl_verify = isset( $r['sslverify'] ) && $r['sslverify'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $is_local = isset( $parsed_args['local'] ) && $parsed_args['local'];
+ $ssl_verify = isset( $parsed_args['sslverify'] ) && $parsed_args['sslverify'];
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $is_local ) {
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters whether SSL should be verified for local requests.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -117,14 +117,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> //'CN_match' => $arrURL['host'], // This is handled by self::verify_ssl_certificate()
</span><span class="cx" style="display: block; padding: 0 10px"> 'capture_peer_cert' => $ssl_verify,
</span><span class="cx" style="display: block; padding: 0 10px"> 'SNI_enabled' => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'cafile' => $r['sslcertificates'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'cafile' => $parsed_args['sslcertificates'],
</ins><span class="cx" style="display: block; padding: 0 10px"> 'allow_self_signed' => ! $ssl_verify,
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $timeout = (int) floor( $r['timeout'] );
- $utimeout = $timeout == $r['timeout'] ? 0 : 1000000 * $r['timeout'] % 1000000;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $timeout = (int) floor( $parsed_args['timeout'] );
+ $utimeout = $timeout == $parsed_args['timeout'] ? 0 : 1000000 * $parsed_args['timeout'] % 1000000;
</ins><span class="cx" style="display: block; padding: 0 10px"> $connect_timeout = max( $timeout, 1 );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Store error number.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,7 +182,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $requestPath = $arrURL['path'] . ( isset( $arrURL['query'] ) ? '?' . $arrURL['query'] : '' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $strHeaders = strtoupper( $r['method'] ) . ' ' . $requestPath . ' HTTP/' . $r['httpversion'] . "\r\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $strHeaders = strtoupper( $parsed_args['method'] ) . ' ' . $requestPath . ' HTTP/' . $parsed_args['httpversion'] . "\r\n";
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $include_port_in_host_header = (
</span><span class="cx" style="display: block; padding: 0 10px"> ( $proxy->is_enabled() && $proxy->send_through_proxy( $url ) ) ||
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -196,16 +196,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $strHeaders .= 'Host: ' . $arrURL['host'] . "\r\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $r['user-agent'] ) ) {
- $strHeaders .= 'User-agent: ' . $r['user-agent'] . "\r\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $parsed_args['user-agent'] ) ) {
+ $strHeaders .= 'User-agent: ' . $parsed_args['user-agent'] . "\r\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( is_array( $r['headers'] ) ) {
- foreach ( (array) $r['headers'] as $header => $headerValue ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( is_array( $parsed_args['headers'] ) ) {
+ foreach ( (array) $parsed_args['headers'] as $header => $headerValue ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $strHeaders .= $header . ': ' . $headerValue . "\r\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $strHeaders .= $r['headers'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $strHeaders .= $parsed_args['headers'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $proxy->use_authentication() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -214,13 +214,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $strHeaders .= "\r\n";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! is_null( $r['body'] ) ) {
- $strHeaders .= $r['body'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! is_null( $parsed_args['body'] ) ) {
+ $strHeaders .= $parsed_args['body'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> fwrite( $handle, $strHeaders );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! $r['blocking'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! $parsed_args['blocking'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> stream_set_blocking( $handle, 0 );
</span><span class="cx" style="display: block; padding: 0 10px"> fclose( $handle );
</span><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -238,16 +238,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $bodyStarted = false;
</span><span class="cx" style="display: block; padding: 0 10px"> $keep_reading = true;
</span><span class="cx" style="display: block; padding: 0 10px"> $block_size = 4096;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $r['limit_response_size'] ) ) {
- $block_size = min( $block_size, $r['limit_response_size'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $parsed_args['limit_response_size'] ) ) {
+ $block_size = min( $block_size, $parsed_args['limit_response_size'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If streaming to a file setup the file handle.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['stream'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['stream'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! WP_DEBUG ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $stream_handle = @fopen( $r['filename'], 'w+' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $stream_handle = @fopen( $parsed_args['filename'], 'w+' );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $stream_handle = fopen( $r['filename'], 'w+' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $stream_handle = fopen( $parsed_args['filename'], 'w+' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $stream_handle ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return new WP_Error(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -256,7 +256,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: fopen(), 2: file name */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'Could not open handle for %1$s to %2$s.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'fopen()',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['filename']
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['filename']
</ins><span class="cx" style="display: block; padding: 0 10px"> )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -277,8 +277,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this_block_size = strlen( $block );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $r['limit_response_size'] ) && ( $bytes_written + $this_block_size ) > $r['limit_response_size'] ) {
- $this_block_size = ( $r['limit_response_size'] - $bytes_written );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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 );
</ins><span class="cx" style="display: block; padding: 0 10px"> $block = substr( $block, 0, $this_block_size );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -292,7 +292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $bytes_written += $bytes_written_to_file;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $keep_reading = ! isset( $r['limit_response_size'] ) || $bytes_written < $r['limit_response_size'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $keep_reading = ! isset( $parsed_args['limit_response_size'] ) || $bytes_written < $parsed_args['limit_response_size'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> fclose( $stream_handle );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -306,7 +306,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $header_length = strpos( $strResponse, "\r\n\r\n" ) + 4;
</span><span class="cx" style="display: block; padding: 0 10px"> $bodyStarted = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $keep_reading = ( ! $bodyStarted || ! isset( $r['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $r['limit_response_size'] ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $keep_reading = ( ! $bodyStarted || ! isset( $parsed_args['limit_response_size'] ) || strlen( $strResponse ) < ( $header_length + $parsed_args['limit_response_size'] ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $process = WP_Http::processResponse( $strResponse );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -324,11 +324,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'body' => null,
</span><span class="cx" style="display: block; padding: 0 10px"> 'response' => $arrHeaders['response'],
</span><span class="cx" style="display: block; padding: 0 10px"> 'cookies' => $arrHeaders['cookies'],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'filename' => $r['filename'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'filename' => $parsed_args['filename'],
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Handle redirects.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $redirect_response = WP_Http::handle_redirects( $url, $r, $response );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $redirect_response = WP_Http::handle_redirects( $url, $parsed_args, $response );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( false !== $redirect_response ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $redirect_response;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -338,12 +338,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $process['body'] = WP_Http::chunkTransferDecode( $process['body'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( true === $r['decompress'] && true === WP_Http_Encoding::should_decode( $arrHeaders['headers'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( true === $parsed_args['decompress'] && true === WP_Http_Encoding::should_decode( $arrHeaders['headers'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $process['body'] = WP_Http_Encoding::decompress( $process['body'] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $r['limit_response_size'] ) && strlen( $process['body'] ) > $r['limit_response_size'] ) {
- $process['body'] = substr( $process['body'], 0, $r['limit_response_size'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $response['body'] = $process['body'];
</span></span></pre></div>
<a id="trunksrcwpincludescommenttemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/comment-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment-template.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/comment-template.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2014,7 +2014,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'echo' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the arguments used in retrieving the comment list.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2023,9 +2023,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_list_comments()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r An array of arguments for displaying comments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args An array of arguments for displaying comments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = apply_filters( 'wp_list_comments_args', $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = apply_filters( 'wp_list_comments_args', $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Figure out what comments we'll be looping through ($_comments)
</span><span class="cx" style="display: block; padding: 0 10px"> if ( null !== $comments ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2033,12 +2033,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $comments ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'all' != $r['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'all' != $parsed_args['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments_by_type = separate_comments( $comments );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $comments_by_type[ $r['type'] ] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_comments = $comments_by_type[ $r['type'] ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_comments = $comments_by_type[ $parsed_args['type'] ];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $_comments = $comments;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2047,7 +2047,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * If 'page' or 'per_page' has been passed, and does not match what's in $wp_query,
</span><span class="cx" style="display: block; padding: 0 10px"> * perform a separate comment query and allow Walker_Comment to paginate.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['page'] || $r['per_page'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['page'] || $parsed_args['per_page'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $current_cpage = get_query_var( 'cpage' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $current_cpage ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $current_cpage = 'newest' === get_option( 'default_comments_page' ) ? 1 : $wp_query->max_num_comment_pages;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2054,7 +2054,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $current_per_page = get_query_var( 'comments_per_page' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['page'] != $current_cpage || $r['per_page'] != $current_per_page ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['page'] != $current_cpage || $parsed_args['per_page'] != $current_per_page ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $comment_args = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_id' => get_the_ID(),
</span><span class="cx" style="display: block; padding: 0 10px"> 'orderby' => 'comment_date_gmt',
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2074,13 +2074,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $comments = get_comments( $comment_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'all' != $r['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'all' != $parsed_args['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $comments_by_type = separate_comments( $comments );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $comments_by_type[ $r['type'] ] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $comments_by_type[ $parsed_args['type'] ] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_comments = $comments_by_type[ $r['type'] ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_comments = $comments_by_type[ $parsed_args['type'] ];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $_comments = $comments;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2091,14 +2091,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $wp_query->comments ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'all' != $r['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'all' != $parsed_args['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $wp_query->comments_by_type ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $wp_query->comments_by_type = separate_comments( $wp_query->comments );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $wp_query->comments_by_type[ $r['type'] ] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $wp_query->comments_by_type[ $parsed_args['type'] ] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_comments = $wp_query->comments_by_type[ $r['type'] ];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_comments = $wp_query->comments_by_type[ $parsed_args['type'] ];
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $_comments = $wp_query->comments;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2107,7 +2107,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $default_comments_page = get_option( 'default_comments_page' );
</span><span class="cx" style="display: block; padding: 0 10px"> $cpage = get_query_var( 'cpage' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'newest' === $default_comments_page ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['cpage'] = $cpage;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['cpage'] = $cpage;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /*
</span><span class="cx" style="display: block; padding: 0 10px"> * When first page shows oldest comments, post permalink is the same as
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2114,66 +2114,66 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * the comment permalink.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $cpage == 1 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['cpage'] = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['cpage'] = '';
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['cpage'] = $cpage;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['cpage'] = $cpage;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['page'] = 0;
- $r['per_page'] = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['page'] = 0;
+ $parsed_args['per_page'] = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '' === $r['per_page'] && get_option( 'page_comments' ) ) {
- $r['per_page'] = get_query_var( 'comments_per_page' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '' === $parsed_args['per_page'] && get_option( 'page_comments' ) ) {
+ $parsed_args['per_page'] = get_query_var( 'comments_per_page' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $r['per_page'] ) ) {
- $r['per_page'] = 0;
- $r['page'] = 0;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $parsed_args['per_page'] ) ) {
+ $parsed_args['per_page'] = 0;
+ $parsed_args['page'] = 0;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '' === $r['max_depth'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '' === $parsed_args['max_depth'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( get_option( 'thread_comments' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['max_depth'] = get_option( 'thread_comments_depth' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['max_depth'] = get_option( 'thread_comments_depth' );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['max_depth'] = -1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['max_depth'] = -1;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '' === $r['page'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '' === $parsed_args['page'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $overridden_cpage ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['page'] = get_query_var( 'cpage' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['page'] = get_query_var( 'cpage' );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $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'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> // Validation check
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['page'] = intval( $r['page'] );
- if ( 0 == $r['page'] && 0 != $r['per_page'] ) {
- $r['page'] = 1;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['page'] = intval( $parsed_args['page'] );
+ if ( 0 == $parsed_args['page'] && 0 != $parsed_args['per_page'] ) {
+ $parsed_args['page'] = 1;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( null === $r['reverse_top_level'] ) {
- $r['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( null === $parsed_args['reverse_top_level'] ) {
+ $parsed_args['reverse_top_level'] = ( 'desc' == get_option( 'comment_order' ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_queue_comments_for_comment_meta_lazyload( $_comments );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $r['walker'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $parsed_args['walker'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $walker = new Walker_Comment;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $walker = $r['walker'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $walker = $parsed_args['walker'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = $walker->paged_walk( $_comments, $r['max_depth'], $r['page'], $r['per_page'], $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = $walker->paged_walk( $_comments, $parsed_args['max_depth'], $parsed_args['page'], $parsed_args['per_page'], $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $in_comment_loop = false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $output;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span></span></pre></div>
<a id="trunksrcwpincludescommentphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/comment.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/comment.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/comment.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -164,15 +164,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return array();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $defaults = array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $defaults = array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'status' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_id' => $post_id,
</span><span class="cx" style="display: block; padding: 0 10px"> 'order' => 'ASC',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query = new WP_Comment_Query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $query->query( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $query->query( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesdeprecatedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/deprecated.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/deprecated.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/deprecated.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -430,9 +430,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'title_li' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return wp_list_bookmarks($r);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return wp_list_bookmarks($parsed_args);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -635,24 +635,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_list_cats($args = '') {
</span><span class="cx" style="display: block; padding: 0 10px"> _deprecated_function( __FUNCTION__, '2.1.0', 'wp_list_categories()' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Map to new names.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 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'] = '';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 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'] = '';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return wp_list_categories($r);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return wp_list_categories($parsed_args);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -892,9 +892,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'title_li' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return wp_list_bookmarks($r);
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return wp_list_bookmarks($parsed_args);
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/functions.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3080,13 +3080,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $args Optional. Arguments to control behavior. Default empty array.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _default_wp_die_handler( $message, $title = '', $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_string( $message ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['additional_errors'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['additional_errors'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $message = array_merge(
</span><span class="cx" style="display: block; padding: 0 10px"> array( $message ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_list_pluck( $r['additional_errors'], 'message' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_list_pluck( $parsed_args['additional_errors'], 'message' )
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $message = "<ul>\n\t\t<li>" . join( "</li>\n\t\t<li>", $message ) . "</li>\n\t</ul>";
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3096,16 +3096,16 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $have_gettext = function_exists( '__' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['link_url'] ) && ! empty( $r['link_text'] ) ) {
- $link_url = $r['link_url'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['link_url'] ) && ! empty( $parsed_args['link_text'] ) ) {
+ $link_url = $parsed_args['link_url'];
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( function_exists( 'esc_url' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $link_url = esc_url( $link_url );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link_text = $r['link_text'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $link_text = $parsed_args['link_text'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $message .= "\n<p><a href='{$link_url}'>{$link_text}</a></p>";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( isset( $r['back_link'] ) && $r['back_link'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $parsed_args['back_link'] ) && $parsed_args['back_link'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $back_text = $have_gettext ? __( '« Back' ) : '« Back';
</span><span class="cx" style="display: block; padding: 0 10px"> $message .= "\n<p><a href='javascript:history.back()'>$back_text</a></p>";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3113,11 +3113,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! did_action( 'admin_head' ) ) :
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! headers_sent() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> header( 'Content-Type: text/html; charset=utf-8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- status_header( $r['response'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ status_header( $parsed_args['response'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> nocache_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $text_direction = $r['text_direction'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $text_direction = $parsed_args['text_direction'];
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $dir_attr = get_language_attributes();
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3258,7 +3258,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> </body>
</span><span class="cx" style="display: block; padding: 0 10px"> </html>
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exit'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exit'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> die();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3282,12 +3282,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> array( 'response' => 200 )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! headers_sent() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // This is intentional. For backward-compatibility, support passing null here.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( null !== $args['response'] ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- status_header( $r['response'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ status_header( $parsed_args['response'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> nocache_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3298,7 +3298,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $message = '0';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exit'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exit'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> die( $message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3318,27 +3318,27 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $args Optional. Arguments to control behavior. Default empty array.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _json_wp_die_handler( $message, $title = '', $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'code' => $r['code'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'code' => $parsed_args['code'],
</ins><span class="cx" style="display: block; padding: 0 10px"> 'message' => $message,
</span><span class="cx" style="display: block; padding: 0 10px"> 'data' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'status' => $r['response'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'status' => $parsed_args['response'],
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'additional_errors' => $r['additional_errors'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'additional_errors' => $parsed_args['additional_errors'],
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! headers_sent() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> header( 'Content-Type: application/json; charset=utf-8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( null !== $r['response'] ) {
- status_header( $r['response'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( null !== $parsed_args['response'] ) {
+ status_header( $parsed_args['response'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> nocache_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> echo wp_json_encode( $data );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exit'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exit'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> die();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3356,15 +3356,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $args Optional. Arguments to control behavior. Default empty array.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _jsonp_wp_die_handler( $message, $title = '', $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $data = array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'code' => $r['code'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'code' => $parsed_args['code'],
</ins><span class="cx" style="display: block; padding: 0 10px"> 'message' => $message,
</span><span class="cx" style="display: block; padding: 0 10px"> 'data' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'status' => $r['response'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'status' => $parsed_args['response'],
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'additional_errors' => $r['additional_errors'],
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'additional_errors' => $parsed_args['additional_errors'],
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! headers_sent() ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3371,8 +3371,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> header( 'Content-Type: application/javascript; charset=utf-8' );
</span><span class="cx" style="display: block; padding: 0 10px"> header( 'X-Content-Type-Options: nosniff' );
</span><span class="cx" style="display: block; padding: 0 10px"> header( 'X-Robots-Tag: noindex' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( null !== $r['response'] ) {
- status_header( $r['response'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( null !== $parsed_args['response'] ) {
+ status_header( $parsed_args['response'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> nocache_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3380,7 +3380,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_json_encode( $data );
</span><span class="cx" style="display: block; padding: 0 10px"> $jsonp_callback = $_GET['_jsonp'];
</span><span class="cx" style="display: block; padding: 0 10px"> echo '/**/' . $jsonp_callback . '(' . $result . ')';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exit'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exit'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> die();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3402,7 +3402,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function _xmlrpc_wp_die_handler( $message, $title = '', $args = array() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_xmlrpc_server;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! headers_sent() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> nocache_headers();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3409,10 +3409,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $wp_xmlrpc_server ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $error = new IXR_Error( $r['response'], $message );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $error = new IXR_Error( $parsed_args['response'], $message );
</ins><span class="cx" style="display: block; padding: 0 10px"> $wp_xmlrpc_server->output( $error->getXml() );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exit'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exit'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> die();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3430,7 +3430,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $args Optional. Arguments to control behavior. Default empty array.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _xml_wp_die_handler( $message, $title = '', $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $message = htmlspecialchars( $message );
</span><span class="cx" style="display: block; padding: 0 10px"> $title = htmlspecialchars( $title );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3437,11 +3437,11 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $xml = <<<EOD
</span><span class="cx" style="display: block; padding: 0 10px"> <error>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <code>{$r['code']}</code>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <code>{$parsed_args['code']}</code>
</ins><span class="cx" style="display: block; padding: 0 10px"> <title><![CDATA[{$title}]]></title>
</span><span class="cx" style="display: block; padding: 0 10px"> <message><![CDATA[{$message}]]></message>
</span><span class="cx" style="display: block; padding: 0 10px"> <data>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <status>{$r['response']}</status>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <status>{$parsed_args['response']}</status>
</ins><span class="cx" style="display: block; padding: 0 10px"> </data>
</span><span class="cx" style="display: block; padding: 0 10px"> </error>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3449,14 +3449,14 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! headers_sent() ) {
</span><span class="cx" style="display: block; padding: 0 10px"> header( 'Content-Type: text/xml; charset=utf-8' );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( null !== $r['response'] ) {
- status_header( $r['response'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( null !== $parsed_args['response'] ) {
+ status_header( $parsed_args['response'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> nocache_headers();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> echo $xml;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exit'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exit'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> die();
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3475,9 +3475,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string|array $args Optional. Arguments to control behavior. Default empty array.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function _scalar_wp_die_handler( $message = '', $title = '', $args = array() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- list( $message, $title, $r ) = _wp_die_process_input( $message, $title, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ list( $message, $title, $parsed_args ) = _wp_die_process_input( $message, $title, $args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['exit'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['exit'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_scalar( $message ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> die( (string) $message );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4107,17 +4107,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function wp_parse_args( $args, $defaults = '' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_object( $args ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = get_object_vars( $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = get_object_vars( $args );
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( is_array( $args ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r =& $args;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args =& $args;
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- wp_parse_str( $args, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_parse_str( $args, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_array( $defaults ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return array_merge( $defaults, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return array_merge( $defaults, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $r;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $parsed_args;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesgeneraltemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/general-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/general-template.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/general-template.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1821,24 +1821,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'w' => get_query_var( 'w' ),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_type_object = get_post_type_object( $r['post_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_type_object = get_post_type_object( $parsed_args['post_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_post_type_viewable( $post_type_object ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['post_type'] = $post_type_object->name;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['post_type'] = $post_type_object->name;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( '' == $r['type'] ) {
- $r['type'] = 'monthly';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( '' == $parsed_args['type'] ) {
+ $parsed_args['type'] = 'monthly';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['limit'] ) ) {
- $r['limit'] = absint( $r['limit'] );
- $r['limit'] = ' LIMIT ' . $r['limit'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['limit'] ) ) {
+ $parsed_args['limit'] = absint( $parsed_args['limit'] );
+ $parsed_args['limit'] = ' LIMIT ' . $parsed_args['limit'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $order = strtoupper( $r['order'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $order = strtoupper( $parsed_args['order'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $order !== 'ASC' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $order = 'DESC';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1846,7 +1846,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // this is what will separate dates on weekly archive links
</span><span class="cx" style="display: block; padding: 0 10px"> $archive_week_separator = '–';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $sql_where = $wpdb->prepare( "WHERE post_type = %s AND post_status = 'publish'", $r['post_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $sql_where = $wpdb->prepare( "WHERE post_type = %s AND post_status = 'publish'", $parsed_args['post_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the SQL WHERE clause for retrieving archives.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1854,9 +1854,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $sql_where Portion of SQL query containing the WHERE clause.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r An array of default arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args An array of default arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $where = apply_filters( 'getarchives_where', $sql_where, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $where = apply_filters( 'getarchives_where', $sql_where, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the SQL JOIN clause for retrieving archives.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1863,18 +1863,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.2.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $sql_join Portion of SQL query containing JOIN clause.
- * @param array $r An array of default arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $sql_join Portion of SQL query containing JOIN clause.
+ * @param array $parsed_args An array of default arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $join = apply_filters( 'getarchives_join', '', $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $join = apply_filters( 'getarchives_join', '', $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $last_changed = wp_cache_get_last_changed( 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $limit = $r['limit'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $limit = $parsed_args['limit'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'monthly' == $r['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'monthly' == $parsed_args['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $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";
</span><span class="cx" style="display: block; padding: 0 10px"> $key = md5( $query );
</span><span class="cx" style="display: block; padding: 0 10px"> $key = "wp_get_archives:$key:$last_changed";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1884,22 +1884,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $key, $results, 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $results ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $after = $r['after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $after = $parsed_args['after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_month_link( $result->year, $result->month );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'post' !== $r['post_type'] ) {
- $url = add_query_arg( 'post_type', $r['post_type'], $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'post' !== $parsed_args['post_type'] ) {
+ $url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> /* translators: 1: month name, 2: 4-digit year */
</span><span class="cx" style="display: block; padding: 0 10px"> $text = sprintf( __( '%1$s %2$d' ), $wp_locale->get_month( $result->month ), $result->year );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_post_count'] ) {
- $r['after'] = ' (' . $result->posts . ')' . $after;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_post_count'] ) {
+ $parsed_args['after'] = ' (' . $result->posts . ')' . $after;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $selected = is_archive() && (string) $r['year'] === $result->year && (string) $r['monthnum'] === $result->month;
- $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $selected = is_archive() && (string) $parsed_args['year'] === $result->year && (string) $parsed_args['monthnum'] === $result->month;
+ $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( 'yearly' == $r['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( 'yearly' == $parsed_args['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $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";
</span><span class="cx" style="display: block; padding: 0 10px"> $key = md5( $query );
</span><span class="cx" style="display: block; padding: 0 10px"> $key = "wp_get_archives:$key:$last_changed";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1909,21 +1909,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $key, $results, 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $results ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $after = $r['after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $after = $parsed_args['after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_year_link( $result->year );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'post' !== $r['post_type'] ) {
- $url = add_query_arg( 'post_type', $r['post_type'], $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'post' !== $parsed_args['post_type'] ) {
+ $url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $text = sprintf( '%d', $result->year );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_post_count'] ) {
- $r['after'] = ' (' . $result->posts . ')' . $after;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_post_count'] ) {
+ $parsed_args['after'] = ' (' . $result->posts . ')' . $after;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $selected = is_archive() && (string) $r['year'] === $result->year;
- $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $selected = is_archive() && (string) $parsed_args['year'] === $result->year;
+ $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( 'daily' == $r['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( 'daily' == $parsed_args['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $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";
</span><span class="cx" style="display: block; padding: 0 10px"> $key = md5( $query );
</span><span class="cx" style="display: block; padding: 0 10px"> $key = "wp_get_archives:$key:$last_changed";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1933,22 +1933,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $key, $results, 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $results ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $after = $r['after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $after = $parsed_args['after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $url = get_day_link( $result->year, $result->month, $result->dayofmonth );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'post' !== $r['post_type'] ) {
- $url = add_query_arg( 'post_type', $r['post_type'], $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'post' !== $parsed_args['post_type'] ) {
+ $url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $date = sprintf( '%1$d-%2$02d-%3$02d 00:00:00', $result->year, $result->month, $result->dayofmonth );
</span><span class="cx" style="display: block; padding: 0 10px"> $text = mysql2date( get_option( 'date_format' ), $date );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_post_count'] ) {
- $r['after'] = ' (' . $result->posts . ')' . $after;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_post_count'] ) {
+ $parsed_args['after'] = ' (' . $result->posts . ')' . $after;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $selected = is_archive() && (string) $r['year'] === $result->year && (string) $r['monthnum'] === $result->month && (string) $r['day'] === $result->dayofmonth;
- $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $selected = is_archive() && (string) $parsed_args['year'] === $result->year && (string) $parsed_args['monthnum'] === $result->month && (string) $parsed_args['day'] === $result->dayofmonth;
+ $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( 'weekly' == $r['type'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( 'weekly' == $parsed_args['type'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $week = _wp_mysql_week( '`post_date`' );
</span><span class="cx" style="display: block; padding: 0 10px"> $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";
</span><span class="cx" style="display: block; padding: 0 10px"> $key = md5( $query );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1960,7 +1960,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $arc_w_last = '';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $results ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $after = $r['after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $after = $parsed_args['after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $results as $result ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $result->week != $arc_w_last ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $arc_year = $result->yr;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1975,20 +1975,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> home_url( '/' )
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'post' !== $r['post_type'] ) {
- $url = add_query_arg( 'post_type', $r['post_type'], $url );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'post' !== $parsed_args['post_type'] ) {
+ $url = add_query_arg( 'post_type', $parsed_args['post_type'], $url );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $text = $arc_week_start . $archive_week_separator . $arc_week_end;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_post_count'] ) {
- $r['after'] = ' (' . $result->posts . ')' . $after;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_post_count'] ) {
+ $parsed_args['after'] = ' (' . $result->posts . ')' . $after;
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $selected = is_archive() && (string) $r['year'] === $result->yr && (string) $r['w'] === $result->week;
- $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $selected = is_archive() && (string) $parsed_args['year'] === $result->yr && (string) $parsed_args['w'] === $result->week;
+ $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- } elseif ( ( 'postbypost' == $r['type'] ) || ( 'alpha' == $r['type'] ) ) {
- $orderby = ( 'alpha' == $r['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC ';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ } elseif ( ( 'postbypost' == $parsed_args['type'] ) || ( 'alpha' == $parsed_args['type'] ) ) {
+ $orderby = ( 'alpha' == $parsed_args['type'] ) ? 'post_title ASC ' : 'post_date DESC, ID DESC ';
</ins><span class="cx" style="display: block; padding: 0 10px"> $query = "SELECT * FROM $wpdb->posts $join $where ORDER BY $orderby $limit";
</span><span class="cx" style="display: block; padding: 0 10px"> $key = md5( $query );
</span><span class="cx" style="display: block; padding: 0 10px"> $key = "wp_get_archives:$key:$last_changed";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2008,12 +2008,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $text = $result->ID;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $selected = $result->ID === get_the_ID();
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= get_archives_link( $url, $text, $r['format'], $r['before'], $r['after'], $selected );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= get_archives_link( $url, $text, $parsed_args['format'], $parsed_args['before'], $parsed_args['after'], $selected );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $output;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return $output;
</span></span></pre></div>
<a id="trunksrcwpincludesposttemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post-template.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/post-template.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -78,24 +78,24 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return string|void String when echo is false.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function the_title_attribute( $args = '' ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $defaults = array(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $defaults = array(
</ins><span class="cx" style="display: block; padding: 0 10px"> 'before' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'after' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> 'echo' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post' => get_post(),
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = get_the_title( $r['post'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $title = get_the_title( $parsed_args['post'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( strlen( $title ) == 0 ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $title = $r['before'] . $title . $r['after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $title = $parsed_args['before'] . $title . $parsed_args['after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $title = esc_attr( strip_tags( $title ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $title;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return $title;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -946,7 +946,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'echo' => 1,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $params = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the arguments used in retrieving page links for paginated posts.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -953,20 +953,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $params An array of arguments for page links for paginated posts.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args An array of arguments for page links for paginated posts.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = apply_filters( 'wp_link_pages_args', $params );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = apply_filters( 'wp_link_pages_args', $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $multipage ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( 'number' == $r['next_or_number'] ) {
- $output .= $r['before'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'number' == $parsed_args['next_or_number'] ) {
+ $output .= $parsed_args['before'];
</ins><span class="cx" style="display: block; padding: 0 10px"> for ( $i = 1; $i <= $numpages; $i++ ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link = $r['link_before'] . str_replace( '%', $i, $r['pagelink'] ) . $r['link_after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $link = $parsed_args['link_before'] . str_replace( '%', $i, $parsed_args['pagelink'] ) . $parsed_args['link_after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $i != $page || ! $more && 1 == $page ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $link = _wp_link_page( $i ) . $link . '</a>';
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $i === $page ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link = '<span class="post-page-numbers current" aria-current="' . esc_attr( $r['aria_current'] ) . '">' . $link . '</span>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $link = '<span class="post-page-numbers current" aria-current="' . esc_attr( $parsed_args['aria_current'] ) . '">' . $link . '</span>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the HTML output of individual page number links.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -979,15 +979,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $link = apply_filters( 'wp_link_pages_link', $link, $i );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Use the custom links separator beginning with the second link.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= ( 1 === $i ) ? ' ' : $r['separator'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= ( 1 === $i ) ? ' ' : $parsed_args['separator'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= $link;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> } elseif ( $more ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['before'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['before'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $prev = $page - 1;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $prev > 0 ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link = _wp_link_page( $prev ) . $r['link_before'] . $r['previouspagelink'] . $r['link_after'] . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $link = _wp_link_page( $prev ) . $parsed_args['link_before'] . $parsed_args['previouspagelink'] . $parsed_args['link_after'] . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/post-template.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= apply_filters( 'wp_link_pages_link', $link, $prev );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -995,14 +995,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $next = $page + 1;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $next <= $numpages ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $prev ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['separator'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['separator'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link = _wp_link_page( $next ) . $r['link_before'] . $r['nextpagelink'] . $r['link_after'] . '</a>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $link = _wp_link_page( $next ) . $parsed_args['link_before'] . $parsed_args['nextpagelink'] . $parsed_args['link_after'] . '</a>';
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/post-template.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= apply_filters( 'wp_link_pages_link', $link, $next );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= $r['after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= $parsed_args['after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1016,7 +1016,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $html = apply_filters( 'wp_link_pages', $output, $args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $html;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $html;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1181,29 +1181,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'value_field' => 'ID',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pages = get_pages( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pages = get_pages( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="cx" style="display: block; padding: 0 10px"> // Back-compat with old system where both id and name were based on $name argument
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $r['id'] ) ) {
- $r['id'] = $r['name'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( empty( $parsed_args['id'] ) ) {
+ $parsed_args['id'] = $parsed_args['name'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $pages ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $class = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['class'] ) ) {
- $class = " class='" . esc_attr( $r['class'] ) . "'";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['class'] ) ) {
+ $class = " class='" . esc_attr( $parsed_args['class'] ) . "'";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = "<select name='" . esc_attr( $r['name'] ) . "'" . $class . " id='" . esc_attr( $r['id'] ) . "'>\n";
- if ( $r['show_option_no_change'] ) {
- $output .= "\t<option value=\"-1\">" . $r['show_option_no_change'] . "</option>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = "<select name='" . esc_attr( $parsed_args['name'] ) . "'" . $class . " id='" . esc_attr( $parsed_args['id'] ) . "'>\n";
+ if ( $parsed_args['show_option_no_change'] ) {
+ $output .= "\t<option value=\"-1\">" . $parsed_args['show_option_no_change'] . "</option>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['show_option_none'] ) {
- $output .= "\t<option value=\"" . esc_attr( $r['option_none_value'] ) . '">' . $r['show_option_none'] . "</option>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['show_option_none'] ) {
+ $output .= "\t<option value=\"" . esc_attr( $parsed_args['option_none_value'] ) . '">' . $parsed_args['show_option_none'] . "</option>\n";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= walk_page_dropdown_tree( $pages, $r['depth'], $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= walk_page_dropdown_tree( $pages, $parsed_args['depth'], $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "</select>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1211,15 +1211,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the HTML output of a list of pages as a drop down.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @since 4.4.0 `$r` and `$pages` added as arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.4.0 `$parsed_args` and `$pages` added as arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $output HTML output for drop down list of pages.
- * @param array $r The parsed arguments array.
- * @param array $pages List of WP_Post objects returned by `get_pages()`
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $output HTML output for drop down list of pages.
+ * @param array $parsed_args The parsed arguments array.
+ * @param array $pages List of WP_Post objects returned by `get_pages()`
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $html = apply_filters( 'wp_dropdown_pages', $output, $r, $pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $html = apply_filters( 'wp_dropdown_pages', $output, $parsed_args, $pages );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $html;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $html;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1282,11 +1282,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'walker' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! in_array( $r['item_spacing'], array( 'preserve', 'discard' ), true ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! in_array( $parsed_args['item_spacing'], array( 'preserve', 'discard' ), true ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // invalid value, fall back to default.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['item_spacing'] = $defaults['item_spacing'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['item_spacing'] = $defaults['item_spacing'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1293,10 +1293,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $current_page = 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // sanitize, mostly to keep spaces out
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['exclude'] = preg_replace( '/[^0-9,]/', '', $r['exclude'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['exclude'] = preg_replace( '/[^0-9,]/', '', $parsed_args['exclude'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Allow plugins to filter an array of excluded pages (but don't put a nullstring into the array)
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $exclude_array = ( $r['exclude'] ) ? explode( ',', $r['exclude'] ) : array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $exclude_array = ( $parsed_args['exclude'] ) ? explode( ',', $parsed_args['exclude'] ) : array();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the array of pages to exclude from the pages list.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1305,15 +1305,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $exclude_array An array of page IDs to exclude.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['exclude'] = implode( ',', apply_filters( 'wp_list_pages_excludes', $exclude_array ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['exclude'] = implode( ',', apply_filters( 'wp_list_pages_excludes', $exclude_array ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['hierarchical'] = 0;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Query pages.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['hierarchical'] = 0;
- $pages = get_pages( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pages = get_pages( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $pages ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['title_li'] ) {
- $output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['title_li'] ) {
+ $output .= '<li class="pagenav">' . $parsed_args['title_li'] . '<ul>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> global $wp_query;
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_page() || is_attachment() || $wp_query->is_posts_page ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1325,9 +1326,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output .= walk_page_tree( $pages, $r['depth'], $current_page, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output .= walk_page_tree( $pages, $parsed_args['depth'], $current_page, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['title_li'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['title_li'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= '</ul></li>';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1340,13 +1341,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @see wp_list_pages()
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param string $output HTML output of the pages list.
- * @param array $r An array of page-listing arguments.
- * @param array $pages List of WP_Post objects returned by `get_pages()`
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param string $output HTML output of the pages list.
+ * @param array $parsed_args An array of page-listing arguments.
+ * @param array $pages List of WP_Post objects returned by `get_pages()`
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $html = apply_filters( 'wp_list_pages', $output, $r, $pages );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $html = apply_filters( 'wp_list_pages', $output, $parsed_args, $pages );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $html;
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> return $html;
</span></span></pre></div>
<a id="trunksrcwpincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/post.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -613,15 +613,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_parent' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $children = get_posts( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $children = get_posts( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $children ) {
</span><span class="cx" style="display: block; padding: 0 10px"> return $kids;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['fields'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['fields'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return $children;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1954,29 +1954,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'suppress_filters' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
- if ( empty( $r['post_status'] ) ) {
- $r['post_status'] = ( 'attachment' == $r['post_type'] ) ? 'inherit' : 'publish';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
+ if ( empty( $parsed_args['post_status'] ) ) {
+ $parsed_args['post_status'] = ( 'attachment' == $parsed_args['post_type'] ) ? 'inherit' : 'publish';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['numberposts'] ) && empty( $r['posts_per_page'] ) ) {
- $r['posts_per_page'] = $r['numberposts'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['numberposts'] ) && empty( $parsed_args['posts_per_page'] ) ) {
+ $parsed_args['posts_per_page'] = $parsed_args['numberposts'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['category'] ) ) {
- $r['cat'] = $r['category'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['category'] ) ) {
+ $parsed_args['cat'] = $parsed_args['category'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['include'] ) ) {
- $incposts = wp_parse_id_list( $r['include'] );
- $r['posts_per_page'] = count( $incposts ); // only the number of posts included
- $r['post__in'] = $incposts;
- } elseif ( ! empty( $r['exclude'] ) ) {
- $r['post__not_in'] = wp_parse_id_list( $r['exclude'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['include'] ) ) {
+ $incposts = wp_parse_id_list( $parsed_args['include'] );
+ $parsed_args['posts_per_page'] = count( $incposts ); // only the number of posts included
+ $parsed_args['post__in'] = $incposts;
+ } elseif ( ! empty( $parsed_args['exclude'] ) ) {
+ $parsed_args['post__not_in'] = wp_parse_id_list( $parsed_args['exclude'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r['ignore_sticky_posts'] = true;
- $r['no_found_rows'] = true;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args['ignore_sticky_posts'] = true;
+ $parsed_args['no_found_rows'] = true;
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $get_posts = new WP_Query;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $get_posts->query( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $get_posts->query( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3381,9 +3381,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'suppress_filters' => true,
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $results = get_posts( $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $results = get_posts( $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Backward compatibility. Prior to 3.1 expected posts to be returned in array.
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ARRAY_A == $output ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5111,21 +5111,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $number = (int) $r['number'];
- $offset = (int) $r['offset'];
- $child_of = (int) $r['child_of'];
- $hierarchical = $r['hierarchical'];
- $exclude = $r['exclude'];
- $meta_key = $r['meta_key'];
- $meta_value = $r['meta_value'];
- $parent = $r['parent'];
- $post_status = $r['post_status'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $number = (int) $parsed_args['number'];
+ $offset = (int) $parsed_args['offset'];
+ $child_of = (int) $parsed_args['child_of'];
+ $hierarchical = $parsed_args['hierarchical'];
+ $exclude = $parsed_args['exclude'];
+ $meta_key = $parsed_args['meta_key'];
+ $meta_value = $parsed_args['meta_value'];
+ $parent = $parsed_args['parent'];
+ $post_status = $parsed_args['post_status'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Make sure the post type is hierarchical.
</span><span class="cx" style="display: block; padding: 0 10px"> $hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! in_array( $r['post_type'], $hierarchical_post_types ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! in_array( $parsed_args['post_type'], $hierarchical_post_types ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5142,7 +5142,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // $args can be whatever, only use the args defined in defaults to compute the key.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $key = md5( serialize( wp_array_slice_assoc( $r, array_keys( $defaults ) ) ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $key = md5( serialize( wp_array_slice_assoc( $parsed_args, array_keys( $defaults ) ) ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> $last_changed = wp_cache_get_last_changed( 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $cache_key = "get_pages:$key:$last_changed";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5151,12 +5151,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Convert to WP_Post instances.
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = array_map( 'get_post', $cache );
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/post.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pages = apply_filters( 'get_pages', $pages, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pages = apply_filters( 'get_pages', $pages, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> return $pages;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $inclusions = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['include'] ) ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['include'] ) ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $child_of = 0; //ignore child_of, parent, exclude, meta_key, and meta_value params if using include
</span><span class="cx" style="display: block; padding: 0 10px"> $parent = -1;
</span><span class="cx" style="display: block; padding: 0 10px"> $exclude = '';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5163,7 +5163,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $meta_key = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $meta_value = '';
</span><span class="cx" style="display: block; padding: 0 10px"> $hierarchical = false;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $incpages = wp_parse_id_list( $r['include'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $incpages = wp_parse_id_list( $parsed_args['include'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $incpages ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $inclusions = ' AND ID IN (' . implode( ',', $incpages ) . ')';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5178,8 +5178,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $author_query = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['authors'] ) ) {
- $post_authors = wp_parse_list( $r['authors'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['authors'] ) ) {
+ $post_authors = wp_parse_list( $parsed_args['authors'] );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! empty( $post_authors ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $post_authors as $post_author ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5233,10 +5233,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 1 == count( $post_status ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $r['post_type'], reset( $post_status ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $where_post_type = $wpdb->prepare( 'post_type = %s AND post_status = %s', $parsed_args['post_type'], reset( $post_status ) );
</ins><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="cx" style="display: block; padding: 0 10px"> $post_status = implode( "', '", $post_status );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $r['post_type'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $where_post_type = $wpdb->prepare( "post_type = %s AND post_status IN ('$post_status')", $parsed_args['post_type'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $orderby_array = array();
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5261,7 +5261,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_count',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- foreach ( explode( ',', $r['sort_column'] ) as $orderby ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( explode( ',', $parsed_args['sort_column'] ) as $orderby ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $orderby = trim( $orderby );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! in_array( $orderby, $allowed_keys ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> continue;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5292,7 +5292,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $sort_column = ! empty( $orderby_array ) ? implode( ',', $orderby_array ) : "$wpdb->posts.post_title";
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $sort_order = strtoupper( $r['sort_order'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $sort_order = strtoupper( $parsed_args['sort_order'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( '' !== $sort_order && ! in_array( $sort_order, array( 'ASC', 'DESC' ) ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $sort_order = 'ASC';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5311,7 +5311,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> wp_cache_set( $cache_key, array(), 'posts' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/post.php */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pages = apply_filters( 'get_pages', array(), $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pages = apply_filters( 'get_pages', array(), $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> return $pages;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5328,8 +5328,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $pages = get_page_children( $child_of, $pages );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $r['exclude_tree'] ) ) {
- $exclude = wp_parse_id_list( $r['exclude_tree'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $parsed_args['exclude_tree'] ) ) {
+ $exclude = wp_parse_id_list( $parsed_args['exclude_tree'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $exclude as $id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $children = get_page_children( $id, $pages );
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $children as $child ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5361,9 +5361,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.1.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $pages List of pages to retrieve.
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r Array of get_pages() arguments.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args Array of get_pages() arguments.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return apply_filters( 'get_pages', $pages, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return apply_filters( 'get_pages', $pages, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> //
</span></span></pre></div>
<a id="trunksrcwpincludestaxonomyphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/taxonomy.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/taxonomy.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/taxonomy.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4295,9 +4295,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'after' => '',
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo $r['before'] . join( $r['sep'], get_the_taxonomies( $r['post'], $r ) ) . $r['after'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ echo $parsed_args['before'] . join( $parsed_args['sep'], get_the_taxonomies( $parsed_args['post'], $parsed_args ) ) . $parsed_args['after'];
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcwpincludesuserphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/user.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/user.php 2019-07-24 22:01:22 UTC (rev 45666)
+++ trunk/src/wp-includes/user.php 2019-07-25 00:47:53 UTC (rev 45667)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1123,13 +1123,13 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $defaults['selected'] = is_author() ? get_query_var( 'author' ) : 0;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $r = wp_parse_args( $args, $defaults );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $parsed_args = wp_parse_args( $args, $defaults );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $query_args = wp_array_slice_assoc( $r, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who', 'role', 'role__in', 'role__not_in' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $query_args = wp_array_slice_assoc( $parsed_args, array( 'blog_id', 'include', 'exclude', 'orderby', 'order', 'who', 'role', 'role__in', 'role__not_in' ) );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $fields = array( 'ID', 'user_login' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $show = ! empty( $r['show'] ) ? $r['show'] : 'display_name';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $show = ! empty( $parsed_args['show'] ) ? $parsed_args['show'] : 'display_name';
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'display_name_with_login' === $show ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $fields[] = 'display_name';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1138,9 +1138,9 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $query_args['fields'] = $fields;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $show_option_all = $r['show_option_all'];
- $show_option_none = $r['show_option_none'];
- $option_none_value = $r['option_none_value'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $show_option_all = $parsed_args['show_option_all'];
+ $show_option_none = $parsed_args['show_option_none'];
+ $option_none_value = $parsed_args['option_none_value'];
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the query arguments for the list of users in the dropdown.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1148,21 +1148,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 4.4.0
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $query_args The query arguments for get_users().
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- * @param array $r The arguments passed to wp_dropdown_users() combined with the defaults.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $parsed_args The arguments passed to wp_dropdown_users() combined with the defaults.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $r );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $query_args = apply_filters( 'wp_dropdown_users_args', $query_args, $parsed_args );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $users = get_users( $query_args );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $output = '';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! empty( $users ) && ( empty( $r['hide_if_only_one_author'] ) || count( $users ) > 1 ) ) {
- $name = esc_attr( $r['name'] );
- if ( $r['multi'] && ! $r['id'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! empty( $users ) && ( empty( $parsed_args['hide_if_only_one_author'] ) || count( $users ) > 1 ) ) {
+ $name = esc_attr( $parsed_args['name'] );
+ if ( $parsed_args['multi'] && ! $parsed_args['id'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $id = '';
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $id = $r['id'] ? " id='" . esc_attr( $r['id'] ) . "'" : " id='$name'";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $id = $parsed_args['id'] ? " id='" . esc_attr( $parsed_args['id'] ) . "'" : " id='$name'";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $output = "<select name='{$name}'{$id} class='" . $r['class'] . "'>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = "<select name='{$name}'{$id} class='" . $parsed_args['class'] . "'>\n";
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $show_option_all ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= "\t<option value='0'>$show_option_all</option>\n";
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1169,22 +1169,22 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $show_option_none ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_selected = selected( $option_none_value, $r['selected'], false );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_selected = selected( $option_none_value, $parsed_args['selected'], false );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\t<option value='" . esc_attr( $option_none_value ) . "'$_selected>$show_option_none</option>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['include_selected'] && ( $r['selected'] > 0 ) ) {
- $found_selected = false;
- $r['selected'] = (int) $r['selected'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['include_selected'] && ( $parsed_args['selected'] > 0 ) ) {
+ $found_selected = false;
+ $parsed_args['selected'] = (int) $parsed_args['selected'];
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( (array) $users as $user ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $user->ID = (int) $user->ID;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $user->ID === $r['selected'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $user->ID === $parsed_args['selected'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $found_selected = true;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $found_selected ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $users[] = get_userdata( $r['selected'] );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $users[] = get_userdata( $parsed_args['selected'] );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1198,7 +1198,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $display = '(' . $user->user_login . ')';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $_selected = selected( $user->ID, $r['selected'], false );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $_selected = selected( $user->ID, $parsed_args['selected'], false );
</ins><span class="cx" style="display: block; padding: 0 10px"> $output .= "\t<option value='$user->ID'$_selected>" . esc_html( $display ) . "</option>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1214,7 +1214,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> $html = apply_filters( 'wp_dropdown_users', $output );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( $r['echo'] ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parsed_args['echo'] ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> echo $html;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> return $html;
</span></span></pre>
</div>
</div>
</body>
</html>