Make WordPress Core

Changeset 62167


Ignore:
Timestamp:
03/27/2026 10:18:14 PM (6 days ago)
Author:
SergeyBiryukov
Message:

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.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/plugin-editor.php

    r60928 r62167  
    165165wp_enqueue_script( 'wp-theme-plugin-editor' );
    166166wp_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 ) ) );
    167 wp_add_inline_script( 'wp-theme-plugin-editor', sprintf( 'wp.themePluginEditor.themeOrPlugin = "plugin";' ) );
     167wp_add_inline_script( 'wp-theme-plugin-editor', 'wp.themePluginEditor.themeOrPlugin = "plugin";' );
    168168
    169169require_once ABSPATH . 'wp-admin/admin-header.php';
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r61946 r62167  
    776776        if ( 1 === $registered_sidebar_count ) {
    777777            $no_areas_shown_message = html_entity_decode(
    778                 sprintf(
    779                     __( 'Your theme has 1 widget area, but this particular page does not display it.' )
    780                 ),
     778                __( 'Your theme has 1 widget area, but this particular page does not display it.' ),
    781779                ENT_QUOTES,
    782780                get_bloginfo( 'charset' )
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r61464 r62167  
    297297    ) {
    298298        if ( ! $this->is_enabled ) {
    299             $this->error = new IXR_Error( 405, sprintf( __( 'XML-RPC services are disabled on this site.' ) ) );
     299            $this->error = new IXR_Error( 405, __( 'XML-RPC services are disabled on this site.' ) );
    300300            return false;
    301301        }
Note: See TracChangeset for help on using the changeset viewer.