Making WordPress.org

Changeset 5118


Ignore:
Timestamp:
03/07/2017 10:17:39 PM (8 years ago)
Author:
coreymckrill
Message:

WC Remote CSS: Don't use a translated string as an ID

In #4966, making the tab labels translatable introduced the possibility
of a fatal error, because the label became part of the required filename.
This removes the possibility by using a separate ID string for the filename.

See #2377

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-remote-css/app/user-interface.php

    r4981 r5118  
    193193    $screen = get_current_screen();
    194194    $tabs   = array(
    195         __( 'Overview',                  'wordcamporg' ),
    196         __( 'Basic Setup',               'wordcamporg' ),
    197         __( 'Automated Synchronization', 'wordcamporg' ),
    198         __( 'Tips',                      'wordcamporg' )
     195        'overview'                  => __( 'Overview',                  'wordcamporg' ),
     196        'basic-setup'               => __( 'Basic Setup',               'wordcamporg' ),
     197        'automated-synchronization' => __( 'Automated Synchronization', 'wordcamporg' ),
     198        'tips'                      => __( 'Tips',                      'wordcamporg' )
    199199    );
    200200
    201     foreach ( $tabs as $tab ) {
     201    foreach ( $tabs as $id => $label ) {
    202202        $screen->add_help_tab( array(
    203             'id'       => 'wcrcss-' . sanitize_title( $tab ),
    204             'title'    => $tab,
     203            'id'       => 'wcrcss-' . $id,
     204            'title'    => $label,
    205205            'callback' => __NAMESPACE__ . '\render_contextual_help_tabs',
    206206        ) );
Note: See TracChangeset for help on using the changeset viewer.