Code Quality: Unwrap sprintf() with one argument.

This removes unnecessary uses of the `sprintf()` function when localizing or outputting static strings. These changes simplify the code and improve readability without affecting functionality.

Props Soean.
See #64898.
Built from https://develop.svn.wordpress.org/trunk@62167


git-svn-id: http://core.svn.wordpress.org/trunk@61449 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov
2026-03-27 22:19:44 +00:00
parent cc54f28979
commit 9d8881c3da
4 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -164,7 +164,7 @@ $settings = array(
);
wp_enqueue_script( 'wp-theme-plugin-editor' );
wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( "#template" ), %s ); } )', wp_json_encode( $settings, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) ) );
wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.themeOrPlugin = "plugin";' ) );
wp_add_inline_script( 'wp-theme-plugin-editor', 'wp.themePluginEditor.themeOrPlugin = "plugin";' );
require_once ABSPATH . 'wp-admin/admin-header.php';
+1 -3
View File
@@ -775,9 +775,7 @@ final class WP_Customize_Widgets {
if ( 1 === $registered_sidebar_count ) {
$no_areas_shown_message = html_entity_decode(
sprintf(
__( 'Your theme has 1 widget area, but this particular page does not display it.' )
),
__( 'Your theme has 1 widget area, but this particular page does not display it.' ),
ENT_QUOTES,
get_bloginfo( 'charset' )
);
+1 -1
View File
@@ -296,7 +296,7 @@ class wp_xmlrpc_server extends IXR_Server {
$password
) {
if ( ! $this->is_enabled ) {
$this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site.' ) ) );
$this->error = new IXR_Error( 405, __( 'XML-RPC services are disabled on this site.' ) );
return false;
}
+1 -1
View File
@@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '7.1-alpha-62166';
$wp_version = '7.1-alpha-62167';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.