WordPress.org

Make WordPress Core

Changeset 19708


Ignore:
Timestamp:
01/08/2012 05:39:49 AM (6 years ago)
Author:
dd32
Message:

s/Faq/FAQ/ for Plugin Installer tabs, Gains Translation support for Tabs/Titles as well. Fixes #16580

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin-install.php

    r19707 r19708  
    251251                                'h1' => array(), 'h2' => array(), 'h3' => array(), 'h4' => array(), 'h5' => array(), 'h6' => array(),
    252252                                'img' => array('src' => array(), 'class' => array(), 'alt' => array()));
     253
     254    $plugins_section_titles = array(
     255                                    'description'  => _x('Description',  'Plugin installer section title'),
     256                                    'installation' => _x('Installation', 'Plugin installer section title'),
     257                                    'faq'          => _x('FAQ',          'Plugin installer section title'),
     258                                    'screenshots'  => _x('Screenshots',  'Plugin installer section title'),
     259                                    'changelog'    => _x('Changelog',    'Plugin installer section title'),
     260                                    'other_notes'  => _x('Other Notes',  'Plugin installer section title')
     261                                    );
     262
     263
    253264    //Sanitize HTML
    254265    foreach ( (array)$api->sections as $section_name => $content )
     
    268279    foreach ( (array)$api->sections as $section_name => $content ) {
    269280
    270         $title = $section_name;
    271         $title = ucwords(str_replace('_', ' ', $title));
     281        if ( isset( $plugins_section_titles[ $section_name ] ) )
     282            $title = $plugins_section_titles[ $section_name ];
     283        else
     284            $title = ucwords( str_replace( '_', ' ', $section_name ) );
    272285
    273286        $class = ( $section_name == $section ) ? ' class="current"' : '';
    274287        $href = add_query_arg( array('tab' => $tab, 'section' => $section_name) );
    275288        $href = esc_url($href);
    276         $san_title = esc_attr(sanitize_title_with_dashes($title));
    277         echo "\t<li><a name='$san_title' target='' href='$href'$class>$title</a></li>\n";
     289        $san_section = esc_attr( $section_name );
     290        echo "\t<li><a name='$san_section' href='$href' $class>$title</a></li>\n";
    278291    }
    279292    echo "</ul>\n";
     
    347360
    348361        foreach ( (array)$api->sections as $section_name => $content ) {
    349             $title = $section_name;
    350             $title[0] = strtoupper($title[0]);
    351             $title = str_replace('_', ' ', $title);
     362
     363            if ( isset( $plugins_section_titles[ $section_name ] ) )
     364                $title = $plugins_section_titles[ $section_name ];
     365            else
     366                $title = ucwords( str_replace( '_', ' ', $section_name ) );
    352367
    353368            $content = links_add_base_url($content, 'http://wordpress.org/extend/plugins/' . $api->slug . '/');
    354369            $content = links_add_target($content, '_blank');
    355370
    356             $san_title = esc_attr(sanitize_title_with_dashes($title));
     371            $san_section = esc_attr( $section_name );
    357372
    358373            $display = ( $section_name == $section ) ? 'block' : 'none';
    359374
    360             echo "\t<div id='section-{$san_title}' class='section' style='display: {$display};'>\n";
     375            echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
    361376            echo "\t\t<h2 class='long-header'>$title</h2>";
    362377            echo $content;
Note: See TracChangeset for help on using the changeset viewer.