Skip to content

Commit

Permalink
Coding Standards: Replace echo sprintf() with printf().
Browse files Browse the repository at this point in the history
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@48111 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Jun 20, 2020
1 parent 738144b commit 8909a91
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/customize.php
Expand Up @@ -219,7 +219,7 @@
<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>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/maint/repair.php
Expand Up @@ -111,7 +111,7 @@
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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/network/sites.php
Expand Up @@ -117,7 +117,7 @@
<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>
Expand Down
8 changes: 4 additions & 4 deletions src/wp-admin/plugin-editor.php
Expand Up @@ -197,18 +197,18 @@
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>' );
}
}
?>
Expand Down
4 changes: 2 additions & 2 deletions src/wp-admin/theme-editor.php
Expand Up @@ -200,7 +200,7 @@
<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' ) ) )
Expand Down Expand Up @@ -362,7 +362,7 @@
<?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/' ) )
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/theme-install.php
Expand Up @@ -391,7 +391,7 @@
<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>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-customize-panel.php
Expand Up @@ -371,7 +371,7 @@ protected function content_template() {
<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 ) { #>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/class-wp-customize-widgets.php
Expand Up @@ -824,7 +824,7 @@ public function output_widget_control_templates() {
<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' ); ?>
Expand Down
Expand Up @@ -208,7 +208,7 @@ public function export_preview_data() {
);

// 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 ) );
}

/**
Expand Down
Expand Up @@ -149,7 +149,7 @@ protected function filter_bar_content_template() {
<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>
Expand Down
2 changes: 1 addition & 1 deletion src/wp-includes/widgets/class-wp-widget-categories.php
Expand Up @@ -66,7 +66,7 @@ public function widget( $args, $instance ) {
);

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;

Expand Down

0 comments on commit 8909a91

Please sign in to comment.