<!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>[51154] trunk/src/wp-includes: Coding Standards: Remove a one-time `$message` variable in some `_doing_it_wrong()` calls.</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/51154">51154</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/51154","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>2021-06-15 15:21:50 +0000 (Tue, 15 Jun 2021)</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: Remove a one-time `$message` variable in some `_doing_it_wrong()` calls.
This brings some consistency with most other calls.
Follow-up to <a href="https://core.trac.wordpress.org/changeset/23378">[23378]</a>, <a href="https://core.trac.wordpress.org/changeset/25605">[25605]</a>, <a href="https://core.trac.wordpress.org/changeset/34745">[34745]</a>, <a href="https://core.trac.wordpress.org/changeset/36219">[36219]</a>, <a href="https://core.trac.wordpress.org/changeset/44108">[44108]</a>, <a href="https://core.trac.wordpress.org/changeset/46111">[46111]</a>, <a href="https://core.trac.wordpress.org/changeset/48156">[48156]</a>.
See <a href="https://core.trac.wordpress.org/ticket/52627">#52627</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesclasswpblockpatterncategoriesregistryphp">trunk/src/wp-includes/class-wp-block-pattern-categories-registry.php</a></li>
<li><a href="#trunksrcwpincludesclasswpblockpatternsregistryphp">trunk/src/wp-includes/class-wp-block-patterns-registry.php</a></li>
<li><a href="#trunksrcwpincludesclasswpblockstylesregistryphp">trunk/src/wp-includes/class-wp-block-styles-registry.php</a></li>
<li><a href="#trunksrcwpincludesclasswpblocktyperegistryphp">trunk/src/wp-includes/class-wp-block-type-registry.php</a></li>
<li><a href="#trunksrcwpincludesclasswpcustomizemanagerphp">trunk/src/wp-includes/class-wp-customize-manager.php</a></li>
<li><a href="#trunksrcwpincludesfunctionswpscriptsphp">trunk/src/wp-includes/functions.wp-scripts.php</a></li>
<li><a href="#trunksrcwpincludesqueryphp">trunk/src/wp-includes/query.php</a></li>
<li><a href="#trunksrcwpincludesshortcodesphp">trunk/src/wp-includes/shortcodes.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesclasswpblockpatterncategoriesregistryphp"></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-block-pattern-categories-registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-block-pattern-categories-registry.php 2021-06-15 14:01:57 UTC (rev 51153)
+++ trunk/src/wp-includes/class-wp-block-pattern-categories-registry.php 2021-06-15 15:21:50 UTC (rev 51154)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -38,7 +38,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function register( $category_name, $category_properties ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $category_name ) || ! is_string( $category_name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _doing_it_wrong( __METHOD__, __( 'Block pattern category name must be a string.' ), '5.5.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Block pattern category name must be a string.' ),
+ '5.5.0'
+ );
</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">@@ -60,9 +64,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function unregister( $category_name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->is_registered( $category_name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Block pattern name. */
- $message = sprintf( __( 'Block pattern category "%s" not found.' ), $category_name );
- _doing_it_wrong( __METHOD__, $message, '5.5.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ /* translators: %s: Block pattern name. */
+ sprintf( __( 'Block pattern category "%s" not found.' ), $category_name ),
+ '5.5.0'
+ );
</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></pre></div>
<a id="trunksrcwpincludesclasswpblockpatternsregistryphp"></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-block-patterns-registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-block-patterns-registry.php 2021-06-15 14:01:57 UTC (rev 51153)
+++ trunk/src/wp-includes/class-wp-block-patterns-registry.php 2021-06-15 15:21:50 UTC (rev 51154)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -41,17 +41,29 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function register( $pattern_name, $pattern_properties ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $pattern_name ) || ! is_string( $pattern_name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _doing_it_wrong( __METHOD__, __( 'Pattern name must be a string.' ), '5.5.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Pattern name must be a string.' ),
+ '5.5.0'
+ );
</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="cx" style="display: block; padding: 0 10px"> if ( ! isset( $pattern_properties['title'] ) || ! is_string( $pattern_properties['title'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _doing_it_wrong( __METHOD__, __( 'Pattern title must be a string.' ), '5.5.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Pattern title must be a string.' ),
+ '5.5.0'
+ );
</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="cx" style="display: block; padding: 0 10px"> if ( ! isset( $pattern_properties['content'] ) || ! is_string( $pattern_properties['content'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _doing_it_wrong( __METHOD__, __( 'Pattern content must be a string.' ), '5.5.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Pattern content must be a string.' ),
+ '5.5.0'
+ );
</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">@@ -73,9 +85,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function unregister( $pattern_name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->is_registered( $pattern_name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Pattern name. */
- $message = sprintf( __( 'Pattern "%s" not found.' ), $pattern_name );
- _doing_it_wrong( __METHOD__, $message, '5.5.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ /* translators: %s: Pattern name. */
+ sprintf( __( 'Pattern "%s" not found.' ), $pattern_name ),
+ '5.5.0'
+ );
</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></pre></div>
<a id="trunksrcwpincludesclasswpblockstylesregistryphp"></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-block-styles-registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-block-styles-registry.php 2021-06-15 14:01:57 UTC (rev 51153)
+++ trunk/src/wp-includes/class-wp-block-styles-registry.php 2021-06-15 15:21:50 UTC (rev 51154)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,14 +43,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function register( $block_name, $style_properties ) {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! isset( $block_name ) || ! is_string( $block_name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = __( 'Block name must be a string.' );
- _doing_it_wrong( __METHOD__, $message, '5.3.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Block name must be a string.' ),
+ '5.3.0'
+ );
</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="cx" style="display: block; padding: 0 10px"> if ( ! isset( $style_properties['name'] ) || ! is_string( $style_properties['name'] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = __( 'Block style name must be a string.' );
- _doing_it_wrong( __METHOD__, $message, '5.3.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Block style name must be a string.' ),
+ '5.3.0'
+ );
</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">@@ -73,9 +79,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function unregister( $block_name, $block_style_name ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! $this->is_registered( $block_name, $block_style_name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: 1: Block name, 2: Block style name. */
- $message = sprintf( __( 'Block "%1$s" does not contain a style named "%2$s".' ), $block_name, $block_style_name );
- _doing_it_wrong( __METHOD__, $message, '5.3.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ /* translators: 1: Block name, 2: Block style name. */
+ sprintf( __( 'Block "%1$s" does not contain a style named "%2$s".' ), $block_name, $block_style_name ),
+ '5.3.0'
+ );
</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></pre></div>
<a id="trunksrcwpincludesclasswpblocktyperegistryphp"></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-block-type-registry.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-block-type-registry.php 2021-06-15 14:01:57 UTC (rev 51153)
+++ trunk/src/wp-includes/class-wp-block-type-registry.php 2021-06-15 15:21:50 UTC (rev 51154)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,28 +52,40 @@
</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 ( ! is_string( $name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = __( 'Block type names must be strings.' );
- _doing_it_wrong( __METHOD__, $message, '5.0.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Block type names must be strings.' ),
+ '5.0.0'
+ );
</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="cx" style="display: block; padding: 0 10px"> if ( preg_match( '/[A-Z]+/', $name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = __( 'Block type names must not contain uppercase characters.' );
- _doing_it_wrong( __METHOD__, $message, '5.0.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Block type names must not contain uppercase characters.' ),
+ '5.0.0'
+ );
</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="cx" style="display: block; padding: 0 10px"> $name_matcher = '/^[a-z0-9-]+\/[a-z0-9-]+$/';
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! preg_match( $name_matcher, $name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = __( 'Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type' );
- _doing_it_wrong( __METHOD__, $message, '5.0.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ __( 'Block type names must contain a namespace prefix. Example: my-plugin/my-custom-block-type' ),
+ '5.0.0'
+ );
</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="cx" style="display: block; padding: 0 10px"> if ( $this->is_registered( $name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Block name. */
- $message = sprintf( __( 'Block type "%s" is already registered.' ), $name );
- _doing_it_wrong( __METHOD__, $message, '5.0.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ /* translators: %s: Block name. */
+ sprintf( __( 'Block type "%s" is already registered.' ), $name ),
+ '5.0.0'
+ );
</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">@@ -101,9 +113,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"> if ( ! $this->is_registered( $name ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Block name. */
- $message = sprintf( __( 'Block type "%s" is not registered.' ), $name );
- _doing_it_wrong( __METHOD__, $message, '5.0.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
+ /* translators: %s: Block name. */
+ sprintf( __( 'Block type "%s" is not registered.' ), $name ),
+ '5.0.0'
+ );
</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></pre></div>
<a id="trunksrcwpincludesclasswpcustomizemanagerphp"></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-customize-manager.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/class-wp-customize-manager.php 2021-06-15 14:01:57 UTC (rev 51153)
+++ trunk/src/wp-includes/class-wp-customize-manager.php 2021-06-15 15:21:50 UTC (rev 51154)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3907,18 +3907,20 @@
</span><span class="cx" style="display: block; padding: 0 10px"> public function remove_panel( $id ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Removing core components this way is _doing_it_wrong().
</span><span class="cx" style="display: block; padding: 0 10px"> if ( in_array( $id, $this->components, true ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = sprintf(
- /* translators: 1: Panel ID, 2: Link to 'customize_loaded_components' filter reference. */
- __( 'Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.' ),
- $id,
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __METHOD__,
</ins><span class="cx" style="display: block; padding: 0 10px"> sprintf(
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- '<a href="%1$s">%2$s</a>',
- esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ),
- '<code>customize_loaded_components</code>'
- )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: 1: Panel ID, 2: Link to 'customize_loaded_components' filter reference. */
+ __( 'Removing %1$s manually will cause PHP warnings. Use the %2$s filter instead.' ),
+ $id,
+ sprintf(
+ '<a href="%1$s">%2$s</a>',
+ esc_url( 'https://developer.wordpress.org/reference/hooks/customize_loaded_components/' ),
+ '<code>customize_loaded_components</code>'
+ )
+ ),
+ '4.5.0'
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- _doing_it_wrong( __METHOD__, $message, '4.5.0' );
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> unset( $this->panels[ $id ] );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpincludesfunctionswpscriptsphp"></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.wp-scripts.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/functions.wp-scripts.php 2021-06-15 14:01:57 UTC (rev 51153)
+++ trunk/src/wp-includes/functions.wp-scripts.php 2021-06-15 15:21:50 UTC (rev 51154)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -304,13 +304,16 @@
</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 ( in_array( $handle, $not_allowed, true ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = sprintf(
- /* translators: 1: Script name, 2: wp_enqueue_scripts */
- __( 'Do not deregister the %1$s script in the administration area. To target the front-end theme, use the %2$s hook.' ),
- "<code>$handle</code>",
- '<code>wp_enqueue_scripts</code>'
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __FUNCTION__,
+ sprintf(
+ /* translators: 1: Script name, 2: wp_enqueue_scripts */
+ __( 'Do not deregister the %1$s script in the administration area. To target the front-end theme, use the %2$s hook.' ),
+ "<code>$handle</code>",
+ '<code>wp_enqueue_scripts</code>'
+ ),
+ '3.6.0'
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _doing_it_wrong( __FUNCTION__, $message, '3.6.0' );
</del><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></span></pre></div>
<a id="trunksrcwpincludesqueryphp"></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/query.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/query.php 2021-06-15 14:01:57 UTC (rev 51153)
+++ trunk/src/wp-includes/query.php 2021-06-15 15:21:50 UTC (rev 51154)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -899,19 +899,23 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @return bool Whether the query is the main query.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function is_main_query() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ global $wp_query;
+
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( 'pre_get_posts' === current_filter() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = sprintf(
- /* translators: 1: pre_get_posts, 2: WP_Query->is_main_query(), 3: is_main_query(), 4: Documentation URL. */
- __( 'In %1$s, use the %2$s method, not the %3$s function. See %4$s.' ),
- '<code>pre_get_posts</code>',
- '<code>WP_Query->is_main_query()</code>',
- '<code>is_main_query()</code>',
- __( 'https://developer.wordpress.org/reference/functions/is_main_query/' )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __FUNCTION__,
+ sprintf(
+ /* translators: 1: pre_get_posts, 2: WP_Query->is_main_query(), 3: is_main_query(), 4: Documentation URL. */
+ __( 'In %1$s, use the %2$s method, not the %3$s function. See %4$s.' ),
+ '<code>pre_get_posts</code>',
+ '<code>WP_Query->is_main_query()</code>',
+ '<code>is_main_query()</code>',
+ __( 'https://developer.wordpress.org/reference/functions/is_main_query/' )
+ ),
+ '3.7.0'
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- _doing_it_wrong( __FUNCTION__, $message, '3.7.0' );
</del><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">- global $wp_query;
</del><span class="cx" style="display: block; padding: 0 10px"> return $wp_query->is_main_query();
</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="trunksrcwpincludesshortcodesphp"></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/shortcodes.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/shortcodes.php 2021-06-15 14:01:57 UTC (rev 51153)
+++ trunk/src/wp-includes/shortcodes.php 2021-06-15 15:21:50 UTC (rev 51154)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,15 +64,25 @@
</span><span class="cx" style="display: block; padding: 0 10px"> global $shortcode_tags;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( '' === trim( $tag ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $message = __( 'Invalid shortcode name: Empty name given.' );
- _doing_it_wrong( __FUNCTION__, $message, '4.4.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __FUNCTION__,
+ __( 'Invalid shortcode name: Empty name given.' ),
+ '4.4.0'
+ );
</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><span class="cx" style="display: block; padding: 0 10px"> if ( 0 !== preg_match( '@[<>&/\[\]\x00-\x20=]@', $tag ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: 1: Shortcode name, 2: Space-separated list of reserved characters. */
- $message = sprintf( __( 'Invalid shortcode name: %1$s. Do not use spaces or reserved characters: %2$s' ), $tag, '& / < > [ ] =' );
- _doing_it_wrong( __FUNCTION__, $message, '4.4.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __FUNCTION__,
+ sprintf(
+ /* translators: 1: Shortcode name, 2: Space-separated list of reserved characters. */
+ __( 'Invalid shortcode name: %1$s. Do not use spaces or reserved characters: %2$s' ),
+ $tag,
+ '& / < > [ ] ='
+ ),
+ '4.4.0'
+ );
</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><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -314,9 +324,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $attr = shortcode_parse_atts( $m[3] );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ! is_callable( $shortcode_tags[ $tag ] ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- /* translators: %s: Shortcode tag. */
- $message = sprintf( __( 'Attempting to parse a shortcode without a valid callback: %s' ), $tag );
- _doing_it_wrong( __FUNCTION__, $message, '4.3.0' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _doing_it_wrong(
+ __FUNCTION__,
+ /* translators: %s: Shortcode tag. */
+ sprintf( __( 'Attempting to parse a shortcode without a valid callback: %s' ), $tag ),
+ '4.3.0'
+ );
</ins><span class="cx" style="display: block; padding: 0 10px"> return $m[0];
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre>
</div>
</div>
</body>
</html>