Make WordPress Core

Changeset 48111


Ignore:
Timestamp:
06/20/2020 01:16:45 PM (4 years ago)
Author:
SergeyBiryukov
Message:

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

See #49542.

Location:
trunk/src
Files:
11 edited

Legend:

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

    r47816 r48111  
    220220                        <?php
    221221                            /* translators: %s: The site/panel title in the Customizer. */
    222                             echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
     222                            printf( __( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo( 'name', 'display' ) . '</strong>' );
    223223                        ?>
    224224                        </span>
  • trunk/src/wp-admin/maint/repair.php

    r47808 r48111  
    112112            } else {
    113113                /* translators: 1: Table name, 2: Error message. */
    114                 echo sprintf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
     114                printf( __( 'Failed to repair the %1$s table. Error: %2$s' ), "<code>$table</code>", "<code>$check->Msg_text</code>" ) . '<br />';
    115115                $problems[ $table ] = $check->Msg_text;
    116116                $okay               = false;
  • trunk/src/wp-admin/network/sites.php

    r47855 r48111  
    118118                    <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
    119119                    <?php wp_nonce_field( $site_action . '_' . $id, '_wpnonce', false ); ?>
    120                     <p><?php echo sprintf( $manage_actions[ $site_action ], $site_address ); ?></p>
     120                    <p><?php printf( $manage_actions[ $site_action ], $site_address ); ?></p>
    121121                    <?php submit_button( __( 'Confirm' ), 'primary' ); ?>
    122122                </form>
  • trunk/src/wp-admin/plugin-editor.php

    r47894 r48111  
    198198        if ( is_writeable( $real_file ) ) {
    199199            /* translators: %s: Plugin file name. */
    200             echo sprintf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
     200            printf( __( 'Editing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
    201201        } else {
    202202            /* translators: %s: Plugin file name. */
    203             echo sprintf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
     203            printf( __( 'Browsing %s (active)' ), '<strong>' . esc_html( $file ) . '</strong>' );
    204204        }
    205205    } else {
    206206        if ( is_writeable( $real_file ) ) {
    207207            /* translators: %s: Plugin file name. */
    208             echo sprintf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
     208            printf( __( 'Editing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
    209209        } else {
    210210            /* translators: %s: Plugin file name. */
    211             echo sprintf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
     211            printf( __( 'Browsing %s (inactive)' ), '<strong>' . esc_html( $file ) . '</strong>' );
    212212        }
    213213    }
  • trunk/src/wp-admin/theme-editor.php

    r47855 r48111  
    201201        <p>
    202202            <?php
    203             echo sprintf(
     203            printf(
    204204                /* translators: %s: Link to Custom CSS section in the Customizer. */
    205205                __( '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>.' ),
     
    363363                        if ( ! $theme->parent() ) {
    364364                            echo '<p>';
    365                             echo sprintf(
     365                            printf(
    366366                                /* translators: %s: Link to documentation on child themes. */
    367367                                __( '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>.' ),
  • trunk/src/wp-admin/theme-install.php

    r47924 r48111  
    392392                                    <?php
    393393                                    /* translators: %s: Number of ratings. */
    394                                     echo sprintf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
     394                                    printf( __( '(%s ratings)' ), '{{ data.num_ratings }}' );
    395395                                    ?>
    396396                                </a>
  • trunk/src/wp-includes/class-wp-customize-panel.php

    r47387 r48111  
    372372                <?php
    373373                    /* translators: %s: The site/panel title in the Customizer. */
    374                     echo sprintf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
     374                    printf( __( 'You are customizing %s' ), '<strong class="panel-title">{{ data.title }}</strong>' );
    375375                ?>
    376376                </span>
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r48110 r48111  
    825825                    <?php
    826826                        /* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
    827                         echo sprintf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );
     827                        printf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );
    828828                    ?>
    829829                    </span>
  • trunk/src/wp-includes/customize/class-wp-customize-selective-refresh.php

    r47383 r48111  
    209209
    210210        // Export data to JS.
    211         echo sprintf( '<script>var _customizePartialRefreshExports = %s;</script>', wp_json_encode( $exports ) );
     211        printf( '<script>var _customizePartialRefreshExports = %s;</script>', wp_json_encode( $exports ) );
    212212    }
    213213
  • trunk/src/wp-includes/customize/class-wp-customize-themes-section.php

    r47794 r48111  
    150150                <?php
    151151                /* translators: %s: Number of themes displayed. */
    152                 echo sprintf( __( '%s themes' ), '<span class="theme-count">0</span>' );
     152                printf( __( '%s themes' ), '<span class="theme-count">0</span>' );
    153153                ?>
    154154            </span>
  • trunk/src/wp-includes/widgets/class-wp-widget-categories.php

    r48109 r48111  
    6767
    6868        if ( $dropdown ) {
    69             echo sprintf( '<form action="%s" method="get">', esc_url( home_url() ) );
     69            printf( '<form action="%s" method="get">', esc_url( home_url() ) );
    7070            $dropdown_id    = ( $first_dropdown ) ? 'cat' : "{$this->id_base}-dropdown-{$this->number}";
    7171            $first_dropdown = false;
Note: See TracChangeset for help on using the changeset viewer.