Coding Standards: Replace `echo sprintf()` with `printf()`.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48111 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-06-20 13:16:45 +00:00
parent 738144bd05
commit 8909a914c7
11 changed files with 15 additions and 15 deletions

View File

@ -219,7 +219,7 @@ do_action( 'customize_controls_print_scripts' );
<span class="preview-notice">
<?php
/* translators: %s: The site/panel title in the Customizer. */
echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
printf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
?>
</span>
<button type="button" class="customize-help-toggle dashicons dashicons-editor-help" aria-expanded="false"><span class="screen-reader-text"><?php _e( 'Help' ); ?></span></button>

View File

@ -111,7 +111,7 @@ if ( ! defined( 'WP_ALLOW_REPAIR' ) || ! WP_ALLOW_REPAIR ) {
printf( __( 'Successfully repaired the %s table.' ), "<code>$table</code>" );
} else {
/* translators: 1: Table name, 2: Error message. */
echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
$problems[ $table ] = $check->Msg_text;
$okay = false;
}

View File

@ -117,7 +117,7 @@ if ( isset( $_GET['action'] ) ) {
<input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" />
<input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
<?php wp_nonce_field( $site_action . '_' . $id, '_wpnonce', false ); ?>
<p><?php echo sprintf( $manage_actions[ $site_action ], $site_address ); ?></p>
<p><?php printf( $manage_actions[ $site_action ], $site_address ); ?></p>
<?php submit_button( __( 'Confirm' ), 'primary' ); ?>
</form>
</div>

View File

@ -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)' ), '<strong>' . esc_html( $file ) . '</strong>' );
printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
} else {
/* translators: %s: Plugin file name. */
echo sprintf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
}
} else {
if ( is_writeable( $real_file ) ) {
/* translators: %s: Plugin file name. */
echo sprintf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
} else {
/* translators: %s: Plugin file name. */
echo sprintf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
}
}
?>

View File

@ -200,7 +200,7 @@ if ( $file_description !== $file_show ) {
<p><strong><?php _e( 'Did you know?' ); ?></strong></p>
<p>
<?php
echo sprintf(
printf(
/* translators: %s: Link to Custom CSS section in the Customizer. */
__( 'There&#8217;s no need to change your CSS here &mdash; you can edit and live preview CSS changes in the <a href="%s">built-in CSS editor</a>.' ),
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 ) ) :
<?php
if ( ! $theme->parent() ) {
echo '<p>';
echo sprintf(
printf(
/* translators: %s: Link to documentation on child themes. */
__( 'If you need to tweak more than your theme&#8217;s CSS, you might want to try <a href="%s">making a child theme</a>.' ),
esc_url( __( 'https://developer.wordpress.org/themes/advanced-topics/child-themes/' ) )

View File

@ -391,7 +391,7 @@ if ( $tab ) {
<a class="num-ratings" href="{{ data.reviews_url }}">
<?php
/* translators: %s: Number of ratings. */
echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
?>
</a>
</div>

View File

@ -371,7 +371,7 @@ class WP_Customize_Panel {
<span class="preview-notice">
<?php
/* translators: %s: The site/panel title in the Customizer. */
echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
?>
</span>
<# if ( data.description ) { #>

View File

@ -824,7 +824,7 @@ final class WP_Customize_Widgets {
<span class="customize-action">
<?php
/* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
echo sprintf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );
printf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );
?>
</span>
<?php _e( 'Add a Widget' ); ?>

View File

@ -208,7 +208,7 @@ final class WP_Customize_Selective_Refresh {
);
// Export data to JS.
echo sprintf( '<script>var _customizePartialRefreshExports = %s;</script>', wp_json_encode( $exports ) );
printf( '<script>var _customizePartialRefreshExports = %s;</script>', wp_json_encode( $exports ) );
}
/**

View File

@ -149,7 +149,7 @@ class WP_Customize_Themes_Section extends WP_Customize_Section {
<span class="themes-displayed">
<?php
/* translators: %s: Number of themes displayed. */
echo sprintf( __( '%s themes' ), '<span class="theme-count">0</span>' );
printf( __( '%s themes' ), '<span class="theme-count">0</span>' );
?>
</span>
</div>

View File

@ -66,7 +66,7 @@ class WP_Widget_Categories extends WP_Widget {
);
if ( $dropdown ) {
echo sprintf( '<form action="%s" method="get">', esc_url( home_url() ) );
printf( '<form action="%s" method="get">', esc_url( home_url() ) );
$dropdown_id = ( $first_dropdown ) ? 'cat' : "{$this->id_base}-dropdown-{$this->number}";
$first_dropdown = false;