From 8909a914c75f43b3d38fa16d5cdb0e4935da1c99 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 20 Jun 2020 13:16:45 +0000 Subject: [PATCH] Coding Standards: Replace `echo sprintf()` with `printf()`. See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@48111 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/customize.php | 2 +- src/wp-admin/maint/repair.php | 2 +- src/wp-admin/network/sites.php | 2 +- src/wp-admin/plugin-editor.php | 8 ++++---- src/wp-admin/theme-editor.php | 4 ++-- src/wp-admin/theme-install.php | 2 +- src/wp-includes/class-wp-customize-panel.php | 2 +- src/wp-includes/class-wp-customize-widgets.php | 2 +- .../customize/class-wp-customize-selective-refresh.php | 2 +- .../customize/class-wp-customize-themes-section.php | 2 +- src/wp-includes/widgets/class-wp-widget-categories.php | 2 +- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/wp-admin/customize.php b/src/wp-admin/customize.php index 375804d568..72630429cd 100644 --- a/src/wp-admin/customize.php +++ b/src/wp-admin/customize.php @@ -219,7 +219,7 @@ do_action( 'customize_controls_print_scripts' ); ' . get_bloginfo( 'name', 'display' ) . '' ); + printf( __( 'You are customizing %s' ), '' . get_bloginfo( 'name', 'display' ) . '' ); ?> diff --git a/src/wp-admin/maint/repair.php b/src/wp-admin/maint/repair.php index 64242ce6f6..e4ca4544a9 100644 --- a/src/wp-admin/maint/repair.php +++ b/src/wp-admin/maint/repair.php @@ -111,7 +111,7 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) { printf( __( 'Successfully repaired the %s table.' ), "$table" ); } else { /* translators: 1: Table name, 2: Error message. */ - echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "$table", "$check->Msg_text" ) . '
'; + printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "$table", "$check->Msg_text" ) . '
'; $problems[ $table ] = $check->Msg_text; $okay = false; } diff --git a/src/wp-admin/network/sites.php b/src/wp-admin/network/sites.php index 7cd53348f0..16873452d2 100644 --- a/src/wp-admin/network/sites.php +++ b/src/wp-admin/network/sites.php @@ -117,7 +117,7 @@ if ( isset( $_GET['action'] ) ) { -

+

diff --git a/src/wp-admin/plugin-editor.php b/src/wp-admin/plugin-editor.php index 141065eb87..50d5acee4f 100644 --- a/src/wp-admin/plugin-editor.php +++ b/src/wp-admin/plugin-editor.php @@ -197,18 +197,18 @@ $content = esc_textarea( $content ); if ( is_plugin_active( $plugin ) ) { if ( is_writeable( $real_file ) ) { /* translators: %s: Plugin file name. */ - echo sprintf( __( 'Editing %s (active)' ), '' . esc_html( $file ) . '' ); + printf( __( 'Editing %s (active)' ), '' . esc_html( $file ) . '' ); } else { /* translators: %s: Plugin file name. */ - echo sprintf( __( 'Browsing %s (active)' ), '' . esc_html( $file ) . '' ); + printf( __( 'Browsing %s (active)' ), '' . esc_html( $file ) . '' ); } } else { if ( is_writeable( $real_file ) ) { /* translators: %s: Plugin file name. */ - echo sprintf( __( 'Editing %s (inactive)' ), '' . esc_html( $file ) . '' ); + printf( __( 'Editing %s (inactive)' ), '' . esc_html( $file ) . '' ); } else { /* translators: %s: Plugin file name. */ - echo sprintf( __( 'Browsing %s (inactive)' ), '' . esc_html( $file ) . '' ); + printf( __( 'Browsing %s (inactive)' ), '' . esc_html( $file ) . '' ); } } ?> diff --git a/src/wp-admin/theme-editor.php b/src/wp-admin/theme-editor.php index e2a3c778a6..61e15e4bcd 100644 --- a/src/wp-admin/theme-editor.php +++ b/src/wp-admin/theme-editor.php @@ -200,7 +200,7 @@ if ( $file_description !== $file_show ) {

built-in CSS editor.' ), esc_url( add_query_arg( 'autofocus[section]', 'custom_css', admin_url( 'customize.php' ) ) ) @@ -362,7 +362,7 @@ if ( ! in_array( 'theme_editor_notice', $dismissed_pointers, true ) ) : parent() ) { echo '

'; - echo sprintf( + printf( /* translators: %s: Link to documentation on child themes. */ __( 'If you need to tweak more than your theme’s CSS, you might want to try making a child theme.' ), esc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) ) diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 9afa79369f..89ac910e9c 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -391,7 +391,7 @@ if ( $tab ) { diff --git a/src/wp-includes/class-wp-customize-panel.php b/src/wp-includes/class-wp-customize-panel.php index 73ce2734ce..29c023b5fb 100644 --- a/src/wp-includes/class-wp-customize-panel.php +++ b/src/wp-includes/class-wp-customize-panel.php @@ -371,7 +371,7 @@ class WP_Customize_Panel { {{ data.title }}' ); + printf( __( 'You are customizing %s' ), '{{ data.title }}' ); ?> <# if ( data.description ) { #> diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php index e48ad5ab53..872cef24ed 100644 --- a/src/wp-includes/class-wp-customize-widgets.php +++ b/src/wp-includes/class-wp-customize-widgets.php @@ -824,7 +824,7 @@ final class WP_Customize_Widgets { manager->get_panel( 'widgets' )->title ) ); + printf( __( 'Customizing ▸ %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) ); ?> diff --git a/src/wp-includes/customize/class-wp-customize-selective-refresh.php b/src/wp-includes/customize/class-wp-customize-selective-refresh.php index 822b1354c7..7a02bc3cf0 100644 --- a/src/wp-includes/customize/class-wp-customize-selective-refresh.php +++ b/src/wp-includes/customize/class-wp-customize-selective-refresh.php @@ -208,7 +208,7 @@ final class WP_Customize_Selective_Refresh { ); // Export data to JS. - echo sprintf( '', wp_json_encode( $exports ) ); + printf( '', wp_json_encode( $exports ) ); } /** diff --git a/src/wp-includes/customize/class-wp-customize-themes-section.php b/src/wp-includes/customize/class-wp-customize-themes-section.php index 260380191e..75e57398ab 100644 --- a/src/wp-includes/customize/class-wp-customize-themes-section.php +++ b/src/wp-includes/customize/class-wp-customize-themes-section.php @@ -149,7 +149,7 @@ class WP_Customize_Themes_Section extends WP_Customize_Section { 0' ); + printf( __( '%s themes' ), '0' ); ?> diff --git a/src/wp-includes/widgets/class-wp-widget-categories.php b/src/wp-includes/widgets/class-wp-widget-categories.php index b532454fe8..0d53139cc9 100644 --- a/src/wp-includes/widgets/class-wp-widget-categories.php +++ b/src/wp-includes/widgets/class-wp-widget-categories.php @@ -66,7 +66,7 @@ class WP_Widget_Categories extends WP_Widget { ); if ( $dropdown ) { - echo sprintf( '

', esc_url( home_url() ) ); + printf( '', esc_url( home_url() ) ); $dropdown_id = ( $first_dropdown ) ? 'cat' : "{$this->id_base}-dropdown-{$this->number}"; $first_dropdown = false;