<!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>[56680] trunk: Coding Standards: Fix a few newly introduced WPCS issues.</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/56680">56680</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/56680","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>2023-09-25 15:34:34 +0000 (Mon, 25 Sep 2023)</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: Fix a few newly introduced WPCS issues.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/56570">[56570]</a>, <a href="https://core.trac.wordpress.org/changeset/56573">[56573]</a>, <a href="https://core.trac.wordpress.org/changeset/56589">[56589]</a>, <a href="https://core.trac.wordpress.org/changeset/56604">[56604]</a>, <a href="https://core.trac.wordpress.org/changeset/56612">[56612]</a>, <a href="https://core.trac.wordpress.org/changeset/56620">[56620]</a>, <a href="https://core.trac.wordpress.org/changeset/56629">[56629]</a>, <a href="https://core.trac.wordpress.org/changeset/56631">[56631]</a>, <a href="https://core.trac.wordpress.org/changeset/56638">[56638]</a>, <a href="https://core.trac.wordpress.org/changeset/56642">[56642]</a>, <a href="https://core.trac.wordpress.org/changeset/56644">[56644]</a>, <a href="https://core.trac.wordpress.org/changeset/56649">[56649]</a>.
Props jrf.
See <a href="https://core.trac.wordpress.org/ticket/59161">#59161</a>, <a href="https://core.trac.wordpress.org/ticket/58831">#58831</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadminoptionsgeneralphp">trunk/src/wp-admin/options-general.php</a></li>
<li><a href="#trunksrcwpadminpluginsphp">trunk/src/wp-admin/plugins.php</a></li>
<li><a href="#trunksrcwpadminusereditphp">trunk/src/wp-admin/user-edit.php</a></li>
<li><a href="#trunksrcwpincludesblocksupportselementsphp">trunk/src/wp-includes/block-supports/elements.php</a></li>
<li><a href="#trunksrcwpincludesblocksphp">trunk/src/wp-includes/blocks.php</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
<li><a href="#trunksrcwpincludestaxonomyphp">trunk/src/wp-includes/taxonomy.php</a></li>
<li><a href="#trunktestsphpunittestsadminwpTermsListTablephp">trunk/tests/phpunit/tests/admin/wpTermsListTable.php</a></li>
<li><a href="#trunktestsphpunittestsblockseditorphp">trunk/tests/phpunit/tests/blocks/editor.php</a></li>
<li><a href="#trunktestsphpunittestsmediaphp">trunk/tests/phpunit/tests/media.php</a></li>
<li><a href="#trunktestsphpunittestsvarsphp">trunk/tests/phpunit/tests/vars.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadminoptionsgeneralphp"></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/options-general.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/options-general.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/src/wp-admin/options-general.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -140,7 +140,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> $new_admin_email = get_option( 'new_admin_email' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $pending_admin_email_message = sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pending_admin_email_message = sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: New admin email. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'There is a pending change of the admin email to %s.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>' . esc_html( $new_admin_email ) . '</code>'
</span></span></pre></div>
<a id="trunksrcwpadminpluginsphp"></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/plugins.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/plugins.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/src/wp-admin/plugins.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -690,7 +690,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"> } elseif ( isset( $_GET['deleted'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $delete_result = get_transient( 'plugins_delete_result_' . $user_ID );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $delete_result = get_transient( 'plugins_delete_result_' . $user_ID );
</ins><span class="cx" style="display: block; padding: 0 10px"> // Delete it once we're done.
</span><span class="cx" style="display: block; padding: 0 10px"> delete_transient( 'plugins_delete_result_' . $user_ID );
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpadminusereditphp"></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/user-edit.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/user-edit.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/src/wp-admin/user-edit.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -550,7 +550,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $new_email = get_user_meta( $current_user->ID, '_new_email', true );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->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">- $pending_change_message = sprintf(
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $pending_change_message = sprintf(
</ins><span class="cx" style="display: block; padding: 0 10px"> /* translators: %s: New email. */
</span><span class="cx" style="display: block; padding: 0 10px"> __( 'There is a pending change of your email to %s.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> '<code>' . esc_html( $new_email['newemail'] ) . '</code>'
</span></span></pre></div>
<a id="trunksrcwpincludesblocksupportselementsphp"></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/block-supports/elements.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/block-supports/elements.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/src/wp-includes/block-supports/elements.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -98,7 +98,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> foreach ( $element_config['paths'] as $path ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( null !== _wp_array_get( $block['attrs'], explode( '.', $path ), null ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $element_colors_set++;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ++$element_colors_set;
</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="trunksrcwpincludesblocksphp"></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/blocks.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/blocks.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/src/wp-includes/blocks.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -790,20 +790,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Furthermore, prepend the markup for any blocks hooked `before` the given block and as its parent's
</span><span class="cx" style="display: block; padding: 0 10px"> * `first_child`, respectively, to the serialized markup for the given 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">- * @param array $block The block to inject the theme attribute into, and hooked blocks before.
- * @param array $parent The parent block of the given block.
- * @param array $prev The previous sibling block of the given block.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $block The block to inject the theme attribute into, and hooked blocks before.
+ * @param array $parent_block The parent block of the given block.
+ * @param array $prev The previous sibling block of the given block.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string The serialized markup for the given block, with the markup for any hooked blocks prepended to it.
</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 function( &$block, $parent = null, $prev = null ) use ( $context ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return function ( &$block, $parent_block = null, $prev = null ) use ( $context ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> _inject_theme_attribute_in_template_part_block( $block );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $markup = '';
</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 ( $parent && ! $prev ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parent_block && ! $prev ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Candidate for first-child insertion.
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_position = 'first_child';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $anchor_block_type = $parent['blockName'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $anchor_block_type = $parent_block['blockName'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $hooked_block_types = array_keys( get_hooked_blocks( $anchor_block_type, $relative_position ) );
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters the list of hooked block types for a given anchor block type and relative position.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -856,12 +856,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * Append the markup for any blocks hooked `after` the given block and as its parent's
</span><span class="cx" style="display: block; padding: 0 10px"> * `last_child`, respectively, to the serialized markup for the given 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">- * @param array $block The block to inject the hooked blocks after.
- * @param array $parent The parent block of the given block.
- * @param array $next The next sibling block of the given block.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param array $block The block to inject the hooked blocks after.
+ * @param array $parent_block The parent block of the given block.
+ * @param array $next The next sibling block of the given block.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @return string The serialized markup for the given block, with the markup for any hooked blocks appended to it.
</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 function( &$block, $parent = null, $next = null ) use ( $context ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return function ( &$block, $parent_block = null, $next = null ) use ( $context ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $markup = '';
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_position = 'after';
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -873,10 +873,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $markup .= get_comment_delimited_block_content( $hooked_block_type, 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 ( $parent && ! $next ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $parent_block && ! $next ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> // Candidate for last-child insertion.
</span><span class="cx" style="display: block; padding: 0 10px"> $relative_position = 'last_child';
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $anchor_block_type = $parent['blockName'];
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $anchor_block_type = $parent_block['blockName'];
</ins><span class="cx" style="display: block; padding: 0 10px"> $hooked_block_types = array_keys( get_hooked_blocks( $anchor_block_type, $relative_position ) );
</span><span class="cx" style="display: block; padding: 0 10px"> /** This filter is documented in wp-includes/blocks.php */
</span><span class="cx" style="display: block; padding: 0 10px"> $hooked_block_types = apply_filters( 'hooked_block_types', $hooked_block_types, $relative_position, $anchor_block_type, $context );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1059,6 +1059,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $prev = 0 === $block_index
</span><span class="cx" style="display: block; padding: 0 10px"> ? null
</span><span class="cx" style="display: block; padding: 0 10px"> : $block['innerBlocks'][ $block_index - 1 ];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $block_content .= call_user_func_array(
</span><span class="cx" style="display: block; padding: 0 10px"> $pre_callback,
</span><span class="cx" style="display: block; padding: 0 10px"> array( &$inner_block, $block, $prev )
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1071,12 +1072,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $next = count( $block['innerBlocks'] ) - 1 === $block_index
</span><span class="cx" style="display: block; padding: 0 10px"> ? null
</span><span class="cx" style="display: block; padding: 0 10px"> : $block['innerBlocks'][ $block_index + 1 ];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $block_content .= call_user_func_array(
</span><span class="cx" style="display: block; padding: 0 10px"> $post_callback,
</span><span class="cx" style="display: block; padding: 0 10px"> array( &$inner_block, $block, $next )
</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">- $block_index++;
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ++$block_index;
</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">@@ -1130,16 +1132,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $prev = 0 === $index
</span><span class="cx" style="display: block; padding: 0 10px"> ? null
</span><span class="cx" style="display: block; padding: 0 10px"> : $blocks[ $index - 1 ];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $result .= call_user_func_array(
</span><span class="cx" style="display: block; padding: 0 10px"> $pre_callback,
</span><span class="cx" style="display: block; padding: 0 10px"> array( &$block, null, $prev ) // At the top level, there is no parent block to pass to the callback.
</span><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $result .= traverse_and_serialize_block( $block, $pre_callback, $post_callback );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( is_callable( $post_callback ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $next = count( $blocks ) - 1 === $index
</span><span class="cx" style="display: block; padding: 0 10px"> ? null
</span><span class="cx" style="display: block; padding: 0 10px"> : $blocks[ $index + 1 ];
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $result .= call_user_func_array(
</span><span class="cx" style="display: block; padding: 0 10px"> $post_callback,
</span><span class="cx" style="display: block; padding: 0 10px"> array( &$block, null, $next ) // At the top level, there is no parent block to pass to the callback.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1146,6 +1152,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"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $result;
</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="trunksrcwpincludesmediaphp"></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/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/media.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/src/wp-includes/media.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5730,7 +5730,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( null === $maybe_in_viewport ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $header_enforced_contexts = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'template_part_' . WP_TEMPLATE_PART_AREA_HEADER => true,
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'get_header_image_tag' => true,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'get_header_image_tag' => 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"> /**
</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 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/src/wp-includes/taxonomy.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -231,8 +231,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'publicly_queryable' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> 'hierarchical' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> 'labels' => array(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'name' => _x( 'Pattern Categories', 'taxonomy general name' ),
- 'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'name' => _x( 'Pattern Categories', 'taxonomy general name' ),
+ 'singular_name' => _x( 'Pattern Category', 'taxonomy singular name' ),
</ins><span class="cx" style="display: block; padding: 0 10px"> ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'query_var' => false,
</span><span class="cx" style="display: block; padding: 0 10px"> 'rewrite' => false,
</span></span></pre></div>
<a id="trunktestsphpunittestsadminwpTermsListTablephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/admin/wpTermsListTable.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/admin/wpTermsListTable.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/tests/phpunit/tests/admin/wpTermsListTable.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,16 +41,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Call an inaccessible (private or protected) method.
</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 object|string $object Object instance or class string to call the method of.
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @param object|string $instance Object instance or class string to call the method of.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @param string $method_name Name of the method to call.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args Optional. Array of arguments to pass to the method.
</span><span class="cx" style="display: block; padding: 0 10px"> * @return mixed Return value of the method call.
</span><span class="cx" style="display: block; padding: 0 10px"> * @throws ReflectionException If the object could not be reflected upon.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- private function call_inaccessible_method( $object, $method_name, $args = array() ) {
- $method = ( new ReflectionClass( $object ) )->getMethod( $method_name );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ private function call_inaccessible_method( $instance, $method_name, $args = array() ) {
+ $method = ( new ReflectionClass( $instance ) )->getMethod( $method_name );
</ins><span class="cx" style="display: block; padding: 0 10px"> $method->setAccessible( true );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- return $method->invokeArgs( $object, $args );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ return $method->invokeArgs( $instance, $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="trunktestsphpunittestsblockseditorphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/blocks/editor.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/blocks/editor.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/tests/phpunit/tests/blocks/editor.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -543,7 +543,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $settings = get_block_editor_settings( array(), $post_editor_context );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertArrayNotHasKey( 'postContentAttributes', $settings );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
</del><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="trunktestsphpunittestsmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/media.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/tests/phpunit/tests/media.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4436,7 +4436,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $result = null;
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter(
</span><span class="cx" style="display: block; padding: 0 10px"> 'the_content',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function( $content ) use ( &$result ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function ( $content ) use ( &$result ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $attr = $this->get_width_height_for_high_priority();
</span><span class="cx" style="display: block; padding: 0 10px"> $result = wp_get_loading_optimization_attributes( 'img', $attr, 'something_completely_arbitrary' );
</span><span class="cx" style="display: block; padding: 0 10px"> return $content;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -4496,7 +4496,7 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter(
</span><span class="cx" style="display: block; padding: 0 10px"> 'wp_loading_optimization_force_header_contexts',
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function( $context ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ function ( $context ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $contexts['something_completely_arbitrary'] = true;
</span><span class="cx" style="display: block; padding: 0 10px"> return $contexts;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunktestsphpunittestsvarsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/tests/phpunit/tests/vars.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/tests/phpunit/tests/vars.php 2023-09-25 15:16:32 UTC (rev 56679)
+++ trunk/tests/phpunit/tests/vars.php 2023-09-25 15:34:34 UTC (rev 56680)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -34,7 +34,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @return 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">- function get_data_to_test_wp_is_mobile(): array {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function get_data_to_test_wp_is_mobile(): array {
</ins><span class="cx" style="display: block; padding: 0 10px"> return array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'mobile client hint' => array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'headers' => array(
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -104,8 +104,6 @@
</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">- * Tests that wp_is_mobile() .
- *
</del><span class="cx" style="display: block; padding: 0 10px"> * @ticket 59370
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_is_mobile
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -115,7 +113,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $headers Headers in $_SERVER.
</span><span class="cx" style="display: block; padding: 0 10px"> * @param bool $expected Whether expected.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function test_wp_is_mobile( array $headers, bool $expected ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_wp_is_mobile( array $headers, bool $expected ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> foreach ( $headers as $key => $value ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $_SERVER[ $key ] = $value;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -127,7 +125,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_is_mobile
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function test_wp_is_mobile_is_true_with_filter() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_wp_is_mobile_is_true_with_filter() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $this->assertFalse( wp_is_mobile() );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_is_mobile', '__return_true' );
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_is_mobile() );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -138,7 +136,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @covers ::wp_is_mobile
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- function test_wp_is_mobile_is_false_with_filter() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ public function test_wp_is_mobile_is_false_with_filter() {
</ins><span class="cx" style="display: block; padding: 0 10px"> $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Linux; Android 10) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.5938.60 Mobile Safari/537.36';
</span><span class="cx" style="display: block; padding: 0 10px"> $this->assertTrue( wp_is_mobile() );
</span><span class="cx" style="display: block; padding: 0 10px"> add_filter( 'wp_is_mobile', '__return_false' );
</span></span></pre>
</div>
</div>
</body>
</html>