Make WordPress Core


Ignore:
Timestamp:
11/30/2017 11:09:33 PM (8 years ago)
Author:
pento
Message:

Code is Poetry.
WordPress' code just... wasn't.
This is now dealt with.

Props jrf, pento, netweb, GaryJ, jdgrimes, westonruter, Greg Sherwood from PHPCS, and everyone who's ever contributed to WPCS and PHPCS.
Fixes #41057.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r41917 r42343  
    1313
    1414    private static $mce_settings = array();
    15     private static $qt_settings = array();
    16     private static $plugins = array();
    17     private static $qt_buttons = array();
     15    private static $qt_settings  = array();
     16    private static $plugins      = array();
     17    private static $qt_buttons   = array();
    1818    private static $ext_plugins;
    1919    private static $baseurl;
    2020    private static $first_init;
    21     private static $this_tinymce = false;
    22     private static $this_quicktags = false;
    23     private static $has_tinymce = false;
    24     private static $has_quicktags = false;
    25     private static $has_medialib = false;
     21    private static $this_tinymce       = false;
     22    private static $this_quicktags     = false;
     23    private static $has_tinymce        = false;
     24    private static $has_quicktags      = false;
     25    private static $has_medialib       = false;
    2626    private static $editor_buttons_css = true;
    27     private static $drag_drop_upload = false;
    28     private static $old_dfw_compat = false;
     27    private static $drag_drop_upload   = false;
     28    private static $old_dfw_compat     = false;
    2929    private static $translation;
    3030    private static $tinymce_scripts_printed = false;
    31     private static $link_dialog_printed = false;
     31    private static $link_dialog_printed     = false;
    3232
    3333    private function __construct() {}
     
    8181        $settings = apply_filters( 'wp_editor_settings', $settings, $editor_id );
    8282
    83         $set = wp_parse_args( $settings, array(
    84             'wpautop'             => true,
    85             'media_buttons'       => true,
    86             'default_editor'      => '',
    87             'drag_drop_upload'    => false,
    88             'textarea_name'       => $editor_id,
    89             'textarea_rows'       => 20,
    90             'tabindex'            => '',
    91             'tabfocus_elements'   => ':prev,:next',
    92             'editor_css'          => '',
    93             'editor_class'        => '',
    94             'teeny'               => false,
    95             'dfw'                 => false,
    96             '_content_editor_dfw' => false,
    97             'tinymce'             => true,
    98             'quicktags'           => true
    99         ) );
     83        $set = wp_parse_args(
     84            $settings, array(
     85                'wpautop'             => true,
     86                'media_buttons'       => true,
     87                'default_editor'      => '',
     88                'drag_drop_upload'    => false,
     89                'textarea_name'       => $editor_id,
     90                'textarea_rows'       => 20,
     91                'tabindex'            => '',
     92                'tabfocus_elements'   => ':prev,:next',
     93                'editor_css'          => '',
     94                'editor_class'        => '',
     95                'teeny'               => false,
     96                'dfw'                 => false,
     97                '_content_editor_dfw' => false,
     98                'tinymce'             => true,
     99                'quicktags'           => true,
     100            )
     101        );
    100102
    101103        self::$this_tinymce = ( $set['tinymce'] && user_can_richedit() );
     
    110112        self::$this_quicktags = (bool) $set['quicktags'];
    111113
    112         if ( self::$this_tinymce )
     114        if ( self::$this_tinymce ) {
    113115            self::$has_tinymce = true;
    114 
    115         if ( self::$this_quicktags )
     116        }
     117
     118        if ( self::$this_quicktags ) {
    116119            self::$has_quicktags = true;
     120        }
    117121
    118122        if ( $set['dfw'] ) {
     
    120124        }
    121125
    122         if ( empty( $set['editor_height'] ) )
     126        if ( empty( $set['editor_height'] ) ) {
    123127            return $set;
     128        }
    124129
    125130        if ( 'content' === $editor_id && empty( $set['tinymce']['wp_autoresize_on'] ) ) {
     
    127132            $cookie = (int) get_user_setting( 'ed_size' );
    128133
    129             if ( $cookie )
     134            if ( $cookie ) {
    130135                $set['editor_height'] = $cookie;
    131         }
    132 
    133         if ( $set['editor_height'] < 50 )
     136            }
     137        }
     138
     139        if ( $set['editor_height'] < 50 ) {
    134140            $set['editor_height'] = 50;
    135         elseif ( $set['editor_height'] > 5000 )
     141        } elseif ( $set['editor_height'] > 5000 ) {
    136142            $set['editor_height'] = 5000;
     143        }
    137144
    138145        return $set;
     
    148155     */
    149156    public static function editor( $content, $editor_id, $settings = array() ) {
    150         $set = self::parse_settings( $editor_id, $settings );
    151         $editor_class = ' class="' . trim( esc_attr( $set['editor_class'] ) . ' wp-editor-area' ) . '"';
    152         $tabindex = $set['tabindex'] ? ' tabindex="' . (int) $set['tabindex'] . '"' : '';
     157        $set            = self::parse_settings( $editor_id, $settings );
     158        $editor_class   = ' class="' . trim( esc_attr( $set['editor_class'] ) . ' wp-editor-area' ) . '"';
     159        $tabindex       = $set['tabindex'] ? ' tabindex="' . (int) $set['tabindex'] . '"' : '';
    153160        $default_editor = 'html';
    154         $buttons = $autocomplete = '';
     161        $buttons        = $autocomplete = '';
    155162        $editor_id_attr = esc_attr( $editor_id );
    156163
     
    189196
    190197        $switch_class = 'html' === $default_editor ? 'html-active' : 'tmce-active';
    191         $wrap_class = 'wp-core-ui wp-editor-wrap ' . $switch_class;
     198        $wrap_class   = 'wp-core-ui wp-editor-wrap ' . $switch_class;
    192199
    193200        if ( $set['_content_editor_dfw'] ) {
     
    212219                self::$has_medialib = true;
    213220
    214                 if ( ! function_exists( 'media_buttons' ) )
     221                if ( ! function_exists( 'media_buttons' ) ) {
    215222                    include( ABSPATH . 'wp-admin/includes/media.php' );
     223                }
    216224
    217225                echo '<div id="wp-' . $editor_id_attr . '-media-buttons" class="wp-media-buttons">';
     
    251259         * @param string $output Editor's HTML markup.
    252260         */
    253         $the_editor = apply_filters( 'the_editor', '<div id="wp-' . $editor_id_attr . '-editor-container" class="wp-editor-container">' .
     261        $the_editor = apply_filters(
     262            'the_editor', '<div id="wp-' . $editor_id_attr . '-editor-container" class="wp-editor-container">' .
    254263            $quicktags_toolbar .
    255264            '<textarea' . $editor_class . $height . $tabindex . $autocomplete . ' cols="40" name="' . esc_attr( $set['textarea_name'] ) . '" ' .
    256             'id="' . $editor_id_attr . '">%s</textarea></div>' );
     265            'id="' . $editor_id_attr . '">%s</textarea></div>'
     266        );
    257267
    258268        // Prepare the content for the Visual or Text editor, only when TinyMCE is used (back-compat).
     
    305315     * @param array  $set
    306316     */
    307     public static function editor_settings($editor_id, $set) {
     317    public static function editor_settings( $editor_id, $set ) {
    308318        global $tinymce_version;
    309319
    310         if ( empty(self::$first_init) ) {
     320        if ( empty( self::$first_init ) ) {
    311321            if ( is_admin() ) {
    312322                add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 );
     
    321331
    322332            $qtInit = array(
    323                 'id' => $editor_id,
    324                 'buttons' => ''
     333                'id'      => $editor_id,
     334                'buttons' => '',
    325335            );
    326336
    327             if ( is_array($set['quicktags']) )
    328                 $qtInit = array_merge($qtInit, $set['quicktags']);
    329 
    330             if ( empty($qtInit['buttons']) )
     337            if ( is_array( $set['quicktags'] ) ) {
     338                $qtInit = array_merge( $qtInit, $set['quicktags'] );
     339            }
     340
     341            if ( empty( $qtInit['buttons'] ) ) {
    331342                $qtInit['buttons'] = 'strong,em,link,block,del,ins,img,ul,ol,li,code,more,close';
     343            }
    332344
    333345            if ( $set['_content_editor_dfw'] ) {
     
    345357            $qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id );
    346358
    347             self::$qt_settings[$editor_id] = $qtInit;
    348 
    349             self::$qt_buttons = array_merge( self::$qt_buttons, explode(',', $qtInit['buttons']) );
     359            self::$qt_settings[ $editor_id ] = $qtInit;
     360
     361            self::$qt_buttons = array_merge( self::$qt_buttons, explode( ',', $qtInit['buttons'] ) );
    350362        }
    351363
     
    353365
    354366            if ( empty( self::$first_init ) ) {
    355                 $baseurl = self::get_baseurl();
    356                 $mce_locale = self::get_mce_locale();
     367                $baseurl     = self::get_baseurl();
     368                $mce_locale  = self::get_mce_locale();
    357369                $ext_plugins = '';
    358370
     
    429441                        // Remove 'spellchecker' from the internal plugins if added with 'tiny_mce_plugins' filter to prevent errors.
    430442                        // It can be added with 'mce_external_plugins'.
    431                         unset( $plugins[$key] );
     443                        unset( $plugins[ $key ] );
    432444                    }
    433445
     
    450462
    451463                        $loaded_langs = array();
    452                         $strings = '';
     464                        $strings      = '';
    453465
    454466                        if ( ! empty( $mce_external_languages ) ) {
     
    456468                                if ( @is_file( $path ) && @is_readable( $path ) ) {
    457469                                    include_once( $path );
    458                                     $ext_plugins .= $strings . "\n";
     470                                    $ext_plugins   .= $strings . "\n";
    459471                                    $loaded_langs[] = $name;
    460472                                }
     
    468480                            }
    469481
    470                             $url = set_url_scheme( $url );
     482                            $url                           = set_url_scheme( $url );
    471483                            $mce_external_plugins[ $name ] = $url;
    472                             $plugurl = dirname( $url );
    473                             $strings = '';
     484                            $plugurl                       = dirname( $url );
     485                            $strings                       = '';
    474486
    475487                            // Try to load langs/[locale].js and langs/[locale]_dlg.js
     
    478490                                $path = WP_CONTENT_DIR . $path . '/langs/';
    479491
    480                                 if ( function_exists('realpath') )
    481                                     $path = trailingslashit( realpath($path) );
    482 
    483                                 if ( @is_file( $path . $mce_locale . '.js' ) )
     492                                if ( function_exists( 'realpath' ) ) {
     493                                    $path = trailingslashit( realpath( $path ) );
     494                                }
     495
     496                                if ( @is_file( $path . $mce_locale . '.js' ) ) {
    484497                                    $strings .= @file_get_contents( $path . $mce_locale . '.js' ) . "\n";
    485 
    486                                 if ( @is_file( $path . $mce_locale . '_dlg.js' ) )
     498                                }
     499
     500                                if ( @is_file( $path . $mce_locale . '_dlg.js' ) ) {
    487501                                    $strings .= @file_get_contents( $path . $mce_locale . '_dlg.js' ) . "\n";
     502                                }
    488503
    489504                                if ( 'en' != $mce_locale && empty( $strings ) ) {
    490505                                    if ( @is_file( $path . 'en.js' ) ) {
    491                                         $str1 = @file_get_contents( $path . 'en.js' );
     506                                        $str1     = @file_get_contents( $path . 'en.js' );
    492507                                        $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str1, 1 ) . "\n";
    493508                                    }
    494509
    495510                                    if ( @is_file( $path . 'en_dlg.js' ) ) {
    496                                         $str2 = @file_get_contents( $path . 'en_dlg.js' );
     511                                        $str2     = @file_get_contents( $path . 'en_dlg.js' );
    497512                                        $strings .= preg_replace( '/([\'"])en\./', '$1' . $mce_locale . '.', $str2, 1 ) . "\n";
    498513                                    }
    499514                                }
    500515
    501                                 if ( ! empty( $strings ) )
     516                                if ( ! empty( $strings ) ) {
    502517                                    $ext_plugins .= "\n" . $strings . "\n";
     518                                }
    503519                            }
    504520
     
    509525                }
    510526
    511                 self::$plugins = $plugins;
     527                self::$plugins     = $plugins;
    512528                self::$ext_plugins = $ext_plugins;
    513529
    514                 $settings = self::default_settings();
     530                $settings            = self::default_settings();
    515531                $settings['plugins'] = implode( ',', $plugins );
    516532
     
    524540                }
    525541
    526                 $mce_css = $settings['content_css'];
     542                $mce_css       = $settings['content_css'];
    527543                $editor_styles = get_editor_stylesheets();
    528544
     
    566582                 * @param string $editor_id Unique editor identifier, e.g. 'content'.
    567583                 */
    568                 $mce_buttons = apply_filters( 'teeny_mce_buttons', array('bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'fullscreen'), $editor_id );
     584                $mce_buttons   = apply_filters( 'teeny_mce_buttons', array( 'bold', 'italic', 'underline', 'blockquote', 'strikethrough', 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright', 'undo', 'redo', 'link', 'fullscreen' ), $editor_id );
    569585                $mce_buttons_2 = $mce_buttons_3 = $mce_buttons_4 = array();
    570586            } else {
     
    635651                if ( post_type_supports( $post->post_type, 'post-formats' ) ) {
    636652                    $post_format = get_post_format( $post );
    637                     if ( $post_format && ! is_wp_error( $post_format ) )
     653                    if ( $post_format && ! is_wp_error( $post_format ) ) {
    638654                        $body_class .= ' post-format-' . sanitize_html_class( $post_format );
    639                     else
     655                    } else {
    640656                        $body_class .= ' post-format-standard';
     657                    }
    641658                }
    642659
     
    645662                if ( $page_template !== false ) {
    646663                    $page_template = empty( $page_template ) ? 'default' : str_replace( '.', '-', basename( $page_template, '.php' ) );
    647                     $body_class .= ' page-template-' . sanitize_html_class( $page_template );
     664                    $body_class   .= ' page-template-' . sanitize_html_class( $page_template );
    648665                }
    649666            }
     
    656673            }
    657674
    658             $mceInit = array (
    659                 'selector' => "#$editor_id",
    660                 'wpautop' => (bool) $set['wpautop'],
    661                 'indent' => ! $set['wpautop'],
    662                 'toolbar1' => implode( ',', $mce_buttons ),
    663                 'toolbar2' => implode( ',', $mce_buttons_2 ),
    664                 'toolbar3' => implode( ',', $mce_buttons_3 ),
    665                 'toolbar4' => implode( ',', $mce_buttons_4 ),
     675            $mceInit = array(
     676                'selector'          => "#$editor_id",
     677                'wpautop'           => (bool) $set['wpautop'],
     678                'indent'            => ! $set['wpautop'],
     679                'toolbar1'          => implode( ',', $mce_buttons ),
     680                'toolbar2'          => implode( ',', $mce_buttons_2 ),
     681                'toolbar3'          => implode( ',', $mce_buttons_3 ),
     682                'toolbar4'          => implode( ',', $mce_buttons_4 ),
    666683                'tabfocus_elements' => $set['tabfocus_elements'],
    667                 'body_class' => $body_class
     684                'body_class'        => $body_class,
    668685            );
    669686
     
    671688            $mceInit = array_merge( self::$first_init, $mceInit );
    672689
    673             if ( is_array( $set['tinymce'] ) )
     690            if ( is_array( $set['tinymce'] ) ) {
    674691                $mceInit = array_merge( $mceInit, $set['tinymce'] );
     692            }
    675693
    676694            /*
     
    711729            }
    712730
    713             self::$mce_settings[$editor_id] = $mceInit;
     731            self::$mce_settings[ $editor_id ] = $mceInit;
    714732        } // end if self::$this_tinymce
    715733    }
    716734
    717735    /**
    718      *
    719736     * @static
    720737     * @param array $init
     
    726743        foreach ( $init as $key => $value ) {
    727744            if ( is_bool( $value ) ) {
    728                 $val = $value ? 'true' : 'false';
     745                $val      = $value ? 'true' : 'false';
    729746                $options .= $key . ':' . $val . ',';
    730747                continue;
     
    744761
    745762    /**
    746      *
    747763     * @static
    748      * 
     764     *
    749765     * @param bool $default_scripts Optional. Whether default scripts should be enqueued. Default false.
    750766     */
     
    784800         *                       and Quicktags are being loaded.
    785801         */
    786         do_action( 'wp_enqueue_editor', array(
    787             'tinymce'   => ( $default_scripts || self::$has_tinymce ),
    788             'quicktags' => ( $default_scripts || self::$has_quicktags ),
    789         ) );
     802        do_action(
     803            'wp_enqueue_editor', array(
     804                'tinymce'   => ( $default_scripts || self::$has_tinymce ),
     805                'quicktags' => ( $default_scripts || self::$has_quicktags ),
     806            )
     807        );
    790808    }
    791809
     
    819837     *
    820838     * @since 4.8.0
    821      *
    822839     */
    823840    public static function print_default_editor_scripts() {
     
    827844            $settings = self::default_settings();
    828845
    829             $settings['toolbar1'] = 'bold,italic,bullist,numlist,link';
    830             $settings['wpautop'] = false;
    831             $settings['indent'] = true;
     846            $settings['toolbar1']    = 'bold,italic,bullist,numlist,link';
     847            $settings['wpautop']     = false;
     848            $settings['indent']      = true;
    832849            $settings['elementpath'] = false;
    833850
     
    839856            // The 'wpview', 'wpdialogs', and 'media' TinyMCE plugins are not initialized by default.
    840857            // Can be added from js by using the 'wp-before-tinymce-init' event.
    841             $settings['plugins'] = implode( ',', array(
    842                 'charmap',
    843                 'colorpicker',
    844                 'hr',
    845                 'lists',
    846                 'paste',
    847                 'tabfocus',
    848                 'textcolor',
    849                 'fullscreen',
    850                 'wordpress',
    851                 'wpautoresize',
    852                 'wpeditimage',
    853                 'wpemoji',
    854                 'wpgallery',
    855                 'wplink',
    856                 'wptextpattern',
    857             ) );
     858            $settings['plugins'] = implode(
     859                ',', array(
     860                    'charmap',
     861                    'colorpicker',
     862                    'hr',
     863                    'lists',
     864                    'paste',
     865                    'tabfocus',
     866                    'textcolor',
     867                    'fullscreen',
     868                    'wordpress',
     869                    'wpautoresize',
     870                    'wpeditimage',
     871                    'wpemoji',
     872                    'wpgallery',
     873                    'wplink',
     874                    'wptextpattern',
     875                )
     876            );
    858877
    859878            $settings = self::_parse_init( $settings );
     
    878897
    879898        if ( $user_can_richedit ) {
    880             $suffix = SCRIPT_DEBUG ? '' : '.min';
     899            $suffix  = SCRIPT_DEBUG ? '' : '.min';
    881900            $baseurl = self::get_baseurl();
    882901
     
    912931    public static function get_mce_locale() {
    913932        if ( empty( self::$mce_locale ) ) {
    914             $mce_locale = get_user_locale();
     933            $mce_locale       = get_user_locale();
    915934            self::$mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1
    916935        }
     
    942961        foreach ( self::get_translation() as $name => $value ) {
    943962            if ( is_array( $value ) ) {
    944                 $shortcut_labels[$name] = $value[1];
     963                $shortcut_labels[ $name ] = $value[1];
    945964            }
    946965        }
    947966
    948967        $settings = array(
    949             'theme' => 'modern',
    950             'skin' => 'lightgray',
    951             'language' => self::get_mce_locale(),
    952             'formats' => '{' .
     968            'theme'                        => 'modern',
     969            'skin'                         => 'lightgray',
     970            'language'                     => self::get_mce_locale(),
     971            'formats'                      => '{' .
    953972                'alignleft: [' .
    954973                    '{selector: "p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li", styles: {textAlign:"left"}},' .
     
    965984                'strikethrough: {inline: "del"}' .
    966985            '}',
    967             'relative_urls' => false,
    968             'remove_script_host' => false,
    969             'convert_urls' => false,
    970             'browser_spellcheck' => true,
    971             'fix_list_elements' => true,
    972             'entities' => '38,amp,60,lt,62,gt',
    973             'entity_encoding' => 'raw',
    974             'keep_styles' => false,
    975             'cache_suffix' => 'wp-mce-' . $tinymce_version,
    976             'resize' => 'vertical',
    977             'menubar' => false,
    978             'branding' => false,
     986            'relative_urls'                => false,
     987            'remove_script_host'           => false,
     988            'convert_urls'                 => false,
     989            'browser_spellcheck'           => true,
     990            'fix_list_elements'            => true,
     991            'entities'                     => '38,amp,60,lt,62,gt',
     992            'entity_encoding'              => 'raw',
     993            'keep_styles'                  => false,
     994            'cache_suffix'                 => 'wp-mce-' . $tinymce_version,
     995            'resize'                       => 'vertical',
     996            'menubar'                      => false,
     997            'branding'                     => false,
    979998
    980999            // Limit the preview styles in the menu/toolbar
    981             'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform',
     1000            'preview_styles'               => 'font-family font-size font-weight font-style text-decoration text-transform',
    9821001
    9831002            'end_container_on_empty_block' => true,
    984             'wpeditimage_html5_captions' => true,
    985             'wp_lang_attr' => get_bloginfo( 'language' ),
    986             'wp_keep_scroll_position' => false,
    987             'wp_shortcut_labels' => wp_json_encode( $shortcut_labels ),
     1003            'wpeditimage_html5_captions'   => true,
     1004            'wp_lang_attr'                 => get_bloginfo( 'language' ),
     1005            'wp_keep_scroll_position'      => false,
     1006            'wp_shortcut_labels'           => wp_json_encode( $shortcut_labels ),
    9881007        );
    9891008
    990         $suffix = SCRIPT_DEBUG ? '' : '.min';
     1009        $suffix  = SCRIPT_DEBUG ? '' : '.min';
    9911010        $version = 'ver=' . get_bloginfo( 'version' );
    9921011
     
    10011020        if ( empty( self::$translation ) ) {
    10021021            self::$translation = array(
    1003             // Default TinyMCE strings
    1004             'New document' => __( 'New document' ),
    1005             'Formats' => _x( 'Formats', 'TinyMCE' ),
    1006 
    1007             'Headings' => _x( 'Headings', 'TinyMCE' ),
    1008             'Heading 1' => array( __( 'Heading 1' ), 'access1' ),
    1009             'Heading 2' => array( __( 'Heading 2' ), 'access2' ),
    1010             'Heading 3' => array( __( 'Heading 3' ), 'access3' ),
    1011             'Heading 4' => array( __( 'Heading 4' ), 'access4' ),
    1012             'Heading 5' => array( __( 'Heading 5' ), 'access5' ),
    1013             'Heading 6' => array( __( 'Heading 6' ), 'access6' ),
    1014 
    1015             /* translators: block tags */
    1016             'Blocks' => _x( 'Blocks', 'TinyMCE' ),
    1017             'Paragraph' => array( __( 'Paragraph' ), 'access7' ),
    1018             'Blockquote' => array( __( 'Blockquote' ), 'accessQ' ),
    1019             'Div' => _x( 'Div', 'HTML tag' ),
    1020             'Pre' => _x( 'Pre', 'HTML tag' ),
    1021             'Preformatted' => _x( 'Preformatted', 'HTML tag' ),
    1022             'Address' => _x( 'Address', 'HTML tag' ),
    1023 
    1024             'Inline' => _x( 'Inline', 'HTML elements' ),
    1025             'Underline' => array( __( 'Underline' ), 'metaU' ),
    1026             'Strikethrough' => array( __( 'Strikethrough' ), 'accessD' ),
    1027             'Subscript' => __( 'Subscript' ),
    1028             'Superscript' => __( 'Superscript' ),
    1029             'Clear formatting' => __( 'Clear formatting' ),
    1030             'Bold' => array( __( 'Bold' ), 'metaB' ),
    1031             'Italic' => array( __( 'Italic' ), 'metaI' ),
    1032             'Code' => array( __( 'Code' ), 'accessX' ),
    1033             'Source code' => __( 'Source code' ),
    1034             'Font Family' => __( 'Font Family' ),
    1035             'Font Sizes' => __( 'Font Sizes' ),
    1036 
    1037             'Align center' => array( __( 'Align center' ), 'accessC' ),
    1038             'Align right' => array( __( 'Align right' ), 'accessR' ),
    1039             'Align left' => array( __( 'Align left' ), 'accessL' ),
    1040             'Justify' => array( __( 'Justify' ), 'accessJ' ),
    1041             'Increase indent' => __( 'Increase indent' ),
    1042             'Decrease indent' => __( 'Decrease indent' ),
    1043 
    1044             'Cut' => array( __( 'Cut' ), 'metaX' ),
    1045             'Copy' => array( __( 'Copy' ), 'metaC' ),
    1046             'Paste' => array( __( 'Paste' ), 'metaV' ),
    1047             'Select all' => array( __( 'Select all' ), 'metaA' ),
    1048             'Undo' => array( __( 'Undo' ), 'metaZ' ),
    1049             'Redo' => array( __( 'Redo' ), 'metaY' ),
    1050 
    1051             'Ok' => __( 'OK' ),
    1052             'Cancel' => __( 'Cancel' ),
    1053             'Close' => __( 'Close' ),
    1054             'Visual aids' => __( 'Visual aids' ),
    1055 
    1056             'Bullet list' => array( __( 'Bulleted list' ), 'accessU' ),
    1057             'Numbered list' => array( __( 'Numbered list' ), 'accessO' ),
    1058             'Square' => _x( 'Square', 'list style' ),
    1059             'Default' => _x( 'Default', 'list style' ),
    1060             'Circle' => _x( 'Circle', 'list style' ),
    1061             'Disc' => _x('Disc', 'list style' ),
    1062             'Lower Greek' => _x( 'Lower Greek', 'list style' ),
    1063             'Lower Alpha' => _x( 'Lower Alpha', 'list style' ),
    1064             'Upper Alpha' => _x( 'Upper Alpha', 'list style' ),
    1065             'Upper Roman' => _x( 'Upper Roman', 'list style' ),
    1066             'Lower Roman' => _x( 'Lower Roman', 'list style' ),
    1067 
    1068             // Anchor plugin
    1069             'Name' => _x( 'Name', 'Name of link anchor (TinyMCE)' ),
    1070             'Anchor' => _x( 'Anchor', 'Link anchor (TinyMCE)' ),
    1071             'Anchors' => _x( 'Anchors', 'Link anchors (TinyMCE)' ),
    1072             'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' =>
    1073                 __( 'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' ),
    1074             'Id' => _x( 'Id', 'Id for link anchor (TinyMCE)' ),
    1075 
    1076             // Fullpage plugin
    1077             'Document properties' => __( 'Document properties' ),
    1078             'Robots' => __( 'Robots' ),
    1079             'Title' => __( 'Title' ),
    1080             'Keywords' => __( 'Keywords' ),
    1081             'Encoding' => __( 'Encoding' ),
    1082             'Description' => __( 'Description' ),
    1083             'Author' => __( 'Author' ),
    1084 
    1085             // Media, image plugins
    1086             'Image' => __( 'Image' ),
    1087             'Insert/edit image' => array( __( 'Insert/edit image' ), 'accessM' ),
    1088             'General' => __( 'General' ),
    1089             'Advanced' => __( 'Advanced' ),
    1090             'Source' => __( 'Source' ),
    1091             'Border' => __( 'Border' ),
    1092             'Constrain proportions' => __( 'Constrain proportions' ),
    1093             'Vertical space' => __( 'Vertical space' ),
    1094             'Image description' => __( 'Image description' ),
    1095             'Style' => __( 'Style' ),
    1096             'Dimensions' => __( 'Dimensions' ),
    1097             'Insert image' => __( 'Insert image' ),
    1098             'Date/time' => __( 'Date/time' ),
    1099             'Insert date/time' => __( 'Insert date/time' ),
    1100             'Table of Contents' => __( 'Table of Contents' ),
    1101             'Insert/Edit code sample' => __( 'Insert/edit code sample' ),
    1102             'Language' => __( 'Language' ),
    1103             'Media' => __( 'Media' ),
    1104             'Insert/edit media' => __( 'Insert/edit media' ),
    1105             'Poster' => __( 'Poster' ),
    1106             'Alternative source' => __( 'Alternative source' ),
    1107             'Paste your embed code below:' => __( 'Paste your embed code below:' ),
    1108             'Insert video' => __( 'Insert video' ),
    1109             'Embed' => __( 'Embed' ),
    1110 
    1111             // Each of these have a corresponding plugin
    1112             'Special character' => __( 'Special character' ),
    1113             'Right to left' => _x( 'Right to left', 'editor button' ),
    1114             'Left to right' => _x( 'Left to right', 'editor button' ),
    1115             'Emoticons' => __( 'Emoticons' ),
    1116             'Nonbreaking space' => __( 'Nonbreaking space' ),
    1117             'Page break' => __( 'Page break' ),
    1118             'Paste as text' => __( 'Paste as text' ),
    1119             'Preview' => __( 'Preview' ),
    1120             'Print' => __( 'Print' ),
    1121             'Save' => __( 'Save' ),
    1122             'Fullscreen' => __( 'Fullscreen' ),
    1123             'Horizontal line' => __( 'Horizontal line' ),
    1124             'Horizontal space' => __( 'Horizontal space' ),
    1125             'Restore last draft' => __( 'Restore last draft' ),
    1126             'Insert/edit link' => array( __( 'Insert/edit link' ), 'metaK' ),
    1127             'Remove link' => array( __( 'Remove link' ), 'accessS' ),
    1128 
    1129             // Link plugin
    1130             'Link' => __( 'Link' ),
    1131             'Insert link' => __( 'Insert link' ),
    1132             'Insert/edit link' => __( 'Insert/edit link' ),
    1133             'Target' => __( 'Target' ),
    1134             'New window' => __( 'New window' ),
    1135             'Text to display' => __( 'Text to display' ),
    1136             'Url' => __( 'URL' ),
    1137             'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' =>
    1138                 __( 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' ),
    1139             'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' =>
    1140                 __( 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' ),
    1141 
    1142             'Color' => __( 'Color' ),
    1143             'Custom color' => __( 'Custom color' ),
    1144             'Custom...' => _x( 'Custom...', 'label for custom color' ), // no ellipsis
    1145             'No color' => __( 'No color' ),
    1146             'R' => _x( 'R', 'Short for red in RGB' ),
    1147             'G' => _x( 'G', 'Short for green in RGB' ),
    1148             'B' => _x( 'B', 'Short for blue in RGB' ),
    1149 
    1150             // Spelling, search/replace plugins
    1151             'Could not find the specified string.' => __( 'Could not find the specified string.' ),
    1152             'Replace' => _x( 'Replace', 'find/replace' ),
    1153             'Next' => _x( 'Next', 'find/replace' ),
    1154             /* translators: previous */
    1155             'Prev' => _x( 'Prev', 'find/replace' ),
    1156             'Whole words' => _x( 'Whole words', 'find/replace' ),
    1157             'Find and replace' => __( 'Find and replace' ),
    1158             'Replace with' => _x('Replace with', 'find/replace' ),
    1159             'Find' => _x( 'Find', 'find/replace' ),
    1160             'Replace all' => _x( 'Replace all', 'find/replace' ),
    1161             'Match case' => __( 'Match case' ),
    1162             'Spellcheck' => __( 'Check Spelling' ),
    1163             'Finish' => _x( 'Finish', 'spellcheck' ),
    1164             'Ignore all' => _x( 'Ignore all', 'spellcheck' ),
    1165             'Ignore' => _x( 'Ignore', 'spellcheck' ),
    1166             'Add to Dictionary' => __( 'Add to Dictionary' ),
    1167 
    1168             // TinyMCE tables
    1169             'Insert table' => __( 'Insert table' ),
    1170             'Delete table' => __( 'Delete table' ),
    1171             'Table properties' => __( 'Table properties' ),
    1172             'Row properties' => __( 'Table row properties' ),
    1173             'Cell properties' => __( 'Table cell properties' ),
    1174             'Border color' => __( 'Border color' ),
    1175 
    1176             'Row' => __( 'Row' ),
    1177             'Rows' => __( 'Rows' ),
    1178             'Column' => _x( 'Column', 'table column' ),
    1179             'Cols' => _x( 'Cols', 'table columns' ),
    1180             'Cell' => _x( 'Cell', 'table cell' ),
    1181             'Header cell' => __( 'Header cell' ),
    1182             'Header' => _x( 'Header', 'table header' ),
    1183             'Body' => _x( 'Body', 'table body' ),
    1184             'Footer' => _x( 'Footer', 'table footer' ),
    1185 
    1186             'Insert row before' => __( 'Insert row before' ),
    1187             'Insert row after' => __( 'Insert row after' ),
    1188             'Insert column before' => __( 'Insert column before' ),
    1189             'Insert column after' => __( 'Insert column after' ),
    1190             'Paste row before' => __( 'Paste table row before' ),
    1191             'Paste row after' => __( 'Paste table row after' ),
    1192             'Delete row' => __( 'Delete row' ),
    1193             'Delete column' => __( 'Delete column' ),
    1194             'Cut row' => __( 'Cut table row' ),
    1195             'Copy row' => __( 'Copy table row' ),
    1196             'Merge cells' => __( 'Merge table cells' ),
    1197             'Split cell' => __( 'Split table cell' ),
    1198 
    1199             'Height' => __( 'Height' ),
    1200             'Width' => __( 'Width' ),
    1201             'Caption' => __( 'Caption' ),
    1202             'Alignment' => __( 'Alignment' ),
    1203             'H Align' => _x( 'H Align', 'horizontal table cell alignment' ),
    1204             'Left' => __( 'Left' ),
    1205             'Center' => __( 'Center' ),
    1206             'Right' => __( 'Right' ),
    1207             'None' => _x( 'None', 'table cell alignment attribute' ),
    1208             'V Align' => _x( 'V Align', 'vertical table cell alignment' ),
    1209             'Top' => __( 'Top' ),
    1210             'Middle' => __( 'Middle' ),
    1211             'Bottom' => __( 'Bottom' ),
    1212 
    1213             'Row group' => __( 'Row group' ),
    1214             'Column group' => __( 'Column group' ),
    1215             'Row type' => __( 'Row type' ),
    1216             'Cell type' => __( 'Cell type' ),
    1217             'Cell padding' => __( 'Cell padding' ),
    1218             'Cell spacing' => __( 'Cell spacing' ),
    1219             'Scope' => _x( 'Scope', 'table cell scope attribute' ),
    1220 
    1221             'Insert template' => _x( 'Insert template', 'TinyMCE' ),
    1222             'Templates' => _x( 'Templates', 'TinyMCE' ),
    1223 
    1224             'Background color' => __( 'Background color' ),
    1225             'Text color' => __( 'Text color' ),
    1226             'Show blocks' => _x( 'Show blocks', 'editor button' ),
    1227             'Show invisible characters' => __( 'Show invisible characters' ),
    1228 
    1229             /* translators: word count */
    1230             'Words: {0}' => sprintf( __( 'Words: %s' ), '{0}' ),
    1231             'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' =>
    1232                 __( 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' ) . "\n\n" .
    1233                 __( 'If you&#8217;re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.' ),
    1234             'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' =>
    1235                 __( 'Rich Text Area. Press Alt-Shift-H for help.' ),
    1236             'Rich Text Area. Press Control-Option-H for help.' => __( 'Rich Text Area. Press Control-Option-H for help.' ),
    1237             'You have unsaved changes are you sure you want to navigate away?' =>
    1238                 __( 'The changes you made will be lost if you navigate away from this page.' ),
    1239             'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' =>
    1240                 __( 'Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser&#8217;s edit menu instead.' ),
    1241 
    1242             // TinyMCE menus
    1243             'Insert' => _x( 'Insert', 'TinyMCE menu' ),
    1244             'File' => _x( 'File', 'TinyMCE menu' ),
    1245             'Edit' => _x( 'Edit', 'TinyMCE menu' ),
    1246             'Tools' => _x( 'Tools', 'TinyMCE menu' ),
    1247             'View' => _x( 'View', 'TinyMCE menu' ),
    1248             'Table' => _x( 'Table', 'TinyMCE menu' ),
    1249             'Format' => _x( 'Format', 'TinyMCE menu' ),
    1250 
    1251             // WordPress strings
    1252             'Toolbar Toggle' => array( __( 'Toolbar Toggle' ), 'accessZ' ),
    1253             'Insert Read More tag' => array( __( 'Insert Read More tag' ), 'accessT' ),
    1254             'Insert Page Break tag' => array( __( 'Insert Page Break tag' ), 'accessP' ),
    1255             'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor (no ellipsis)
    1256             'Distraction-free writing mode' => array( __( 'Distraction-free writing mode' ), 'accessW' ),
    1257             'No alignment' => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar
    1258             'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar
    1259             'Edit ' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar
    1260             'Paste URL or type to search' => __( 'Paste URL or type to search' ), // Placeholder for the inline link dialog
    1261             'Apply'  => __( 'Apply' ), // Tooltip for the 'apply' button in the inline link dialog
    1262             'Link options'  => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog
    1263             'Visual' => _x( 'Visual', 'Name for the Visual editor tab' ), // Editor switch tab label
    1264             'Text' => _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ), // Editor switch tab label
    1265 
    1266             // Shortcuts help modal
    1267             'Keyboard Shortcuts' => array( __( 'Keyboard Shortcuts' ), 'accessH' ),
    1268             'Default shortcuts,' => __( 'Default shortcuts,' ),
    1269             'Additional shortcuts,' => __( 'Additional shortcuts,' ),
    1270             'Focus shortcuts:' => __( 'Focus shortcuts:' ),
    1271             'Inline toolbar (when an image, link or preview is selected)' => __( 'Inline toolbar (when an image, link or preview is selected)' ),
    1272             'Editor menu (when enabled)' => __( 'Editor menu (when enabled)' ),
    1273             'Editor toolbar' => __( 'Editor toolbar' ),
    1274             'Elements path' => __( 'Elements path' ),
    1275             'Ctrl + Alt + letter:' => __( 'Ctrl + Alt + letter:' ),
    1276             'Shift + Alt + letter:' => __( 'Shift + Alt + letter:' ),
    1277             'Cmd + letter:' => __( 'Cmd + letter:' ),
    1278             'Ctrl + letter:' => __( 'Ctrl + letter:' ),
    1279             'Letter' => __( 'Letter' ),
    1280             'Action' => __( 'Action' ),
    1281             'Warning: the link has been inserted but may have errors. Please test it.' => __( 'Warning: the link has been inserted but may have errors. Please test it.' ),
    1282             'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' =>
    1283                 __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ),
    1284             'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' =>
    1285                 __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ),
    1286             'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' =>
    1287                 __( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ),
    1288             'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' =>
    1289                 __( 'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' ),
     1022                // Default TinyMCE strings
     1023                'New document'                        => __( 'New document' ),
     1024                'Formats'                              => _x( 'Formats', 'TinyMCE' ),
     1025
     1026                'Headings'                            => _x( 'Headings', 'TinyMCE' ),
     1027                'Heading 1'                            => array( __( 'Heading 1' ), 'access1' ),
     1028                'Heading 2'                            => array( __( 'Heading 2' ), 'access2' ),
     1029                'Heading 3'                            => array( __( 'Heading 3' ), 'access3' ),
     1030                'Heading 4'                            => array( __( 'Heading 4' ), 'access4' ),
     1031                'Heading 5'                            => array( __( 'Heading 5' ), 'access5' ),
     1032                'Heading 6'                            => array( __( 'Heading 6' ), 'access6' ),
     1033
     1034                /* translators: block tags */
     1035                'Blocks'                              => _x( 'Blocks', 'TinyMCE' ),
     1036                'Paragraph'                            => array( __( 'Paragraph' ), 'access7' ),
     1037                'Blockquote'                          => array( __( 'Blockquote' ), 'accessQ' ),
     1038                'Div'                                  => _x( 'Div', 'HTML tag' ),
     1039                'Pre'                                  => _x( 'Pre', 'HTML tag' ),
     1040                'Preformatted'                        => _x( 'Preformatted', 'HTML tag' ),
     1041                'Address'                              => _x( 'Address', 'HTML tag' ),
     1042
     1043                'Inline'                              => _x( 'Inline', 'HTML elements' ),
     1044                'Underline'                            => array( __( 'Underline' ), 'metaU' ),
     1045                'Strikethrough'                        => array( __( 'Strikethrough' ), 'accessD' ),
     1046                'Subscript'                            => __( 'Subscript' ),
     1047                'Superscript'                          => __( 'Superscript' ),
     1048                'Clear formatting'                    => __( 'Clear formatting' ),
     1049                'Bold'                                => array( __( 'Bold' ), 'metaB' ),
     1050                'Italic'                              => array( __( 'Italic' ), 'metaI' ),
     1051                'Code'                                => array( __( 'Code' ), 'accessX' ),
     1052                'Source code'                          => __( 'Source code' ),
     1053                'Font Family'                          => __( 'Font Family' ),
     1054                'Font Sizes'                          => __( 'Font Sizes' ),
     1055
     1056                'Align center'                        => array( __( 'Align center' ), 'accessC' ),
     1057                'Align right'                          => array( __( 'Align right' ), 'accessR' ),
     1058                'Align left'                          => array( __( 'Align left' ), 'accessL' ),
     1059                'Justify'                              => array( __( 'Justify' ), 'accessJ' ),
     1060                'Increase indent'                      => __( 'Increase indent' ),
     1061                'Decrease indent'                      => __( 'Decrease indent' ),
     1062
     1063                'Cut'                                  => array( __( 'Cut' ), 'metaX' ),
     1064                'Copy'                                => array( __( 'Copy' ), 'metaC' ),
     1065                'Paste'                                => array( __( 'Paste' ), 'metaV' ),
     1066                'Select all'                          => array( __( 'Select all' ), 'metaA' ),
     1067                'Undo'                                => array( __( 'Undo' ), 'metaZ' ),
     1068                'Redo'                                => array( __( 'Redo' ), 'metaY' ),
     1069
     1070                'Ok'                                  => __( 'OK' ),
     1071                'Cancel'                              => __( 'Cancel' ),
     1072                'Close'                                => __( 'Close' ),
     1073                'Visual aids'                          => __( 'Visual aids' ),
     1074
     1075                'Bullet list'                          => array( __( 'Bulleted list' ), 'accessU' ),
     1076                'Numbered list'                        => array( __( 'Numbered list' ), 'accessO' ),
     1077                'Square'                              => _x( 'Square', 'list style' ),
     1078                'Default'                              => _x( 'Default', 'list style' ),
     1079                'Circle'                              => _x( 'Circle', 'list style' ),
     1080                'Disc'                                 => _x( 'Disc', 'list style' ),
     1081                'Lower Greek'                          => _x( 'Lower Greek', 'list style' ),
     1082                'Lower Alpha'                          => _x( 'Lower Alpha', 'list style' ),
     1083                'Upper Alpha'                          => _x( 'Upper Alpha', 'list style' ),
     1084                'Upper Roman'                          => _x( 'Upper Roman', 'list style' ),
     1085                'Lower Roman'                          => _x( 'Lower Roman', 'list style' ),
     1086
     1087                // Anchor plugin
     1088                'Name'                                => _x( 'Name', 'Name of link anchor (TinyMCE)' ),
     1089                'Anchor'                              => _x( 'Anchor', 'Link anchor (TinyMCE)' ),
     1090                'Anchors'                              => _x( 'Anchors', 'Link anchors (TinyMCE)' ),
     1091                'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' =>
     1092                    __( 'Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.' ),
     1093                'Id'                                  => _x( 'Id', 'Id for link anchor (TinyMCE)' ),
     1094
     1095                // Fullpage plugin
     1096                'Document properties'                  => __( 'Document properties' ),
     1097                'Robots'                              => __( 'Robots' ),
     1098                'Title'                                => __( 'Title' ),
     1099                'Keywords'                            => __( 'Keywords' ),
     1100                'Encoding'                            => __( 'Encoding' ),
     1101                'Description'                          => __( 'Description' ),
     1102                'Author'                              => __( 'Author' ),
     1103
     1104                // Media, image plugins
     1105                'Image'                                => __( 'Image' ),
     1106                'Insert/edit image'                    => array( __( 'Insert/edit image' ), 'accessM' ),
     1107                'General'                              => __( 'General' ),
     1108                'Advanced'                            => __( 'Advanced' ),
     1109                'Source'                              => __( 'Source' ),
     1110                'Border'                              => __( 'Border' ),
     1111                'Constrain proportions'                => __( 'Constrain proportions' ),
     1112                'Vertical space'                      => __( 'Vertical space' ),
     1113                'Image description'                    => __( 'Image description' ),
     1114                'Style'                                => __( 'Style' ),
     1115                'Dimensions'                          => __( 'Dimensions' ),
     1116                'Insert image'                        => __( 'Insert image' ),
     1117                'Date/time'                            => __( 'Date/time' ),
     1118                'Insert date/time'                    => __( 'Insert date/time' ),
     1119                'Table of Contents'                    => __( 'Table of Contents' ),
     1120                'Insert/Edit code sample'              => __( 'Insert/edit code sample' ),
     1121                'Language'                            => __( 'Language' ),
     1122                'Media'                                => __( 'Media' ),
     1123                'Insert/edit media'                    => __( 'Insert/edit media' ),
     1124                'Poster'                              => __( 'Poster' ),
     1125                'Alternative source'                  => __( 'Alternative source' ),
     1126                'Paste your embed code below:'        => __( 'Paste your embed code below:' ),
     1127                'Insert video'                        => __( 'Insert video' ),
     1128                'Embed'                                => __( 'Embed' ),
     1129
     1130                // Each of these have a corresponding plugin
     1131                'Special character'                    => __( 'Special character' ),
     1132                'Right to left'                        => _x( 'Right to left', 'editor button' ),
     1133                'Left to right'                        => _x( 'Left to right', 'editor button' ),
     1134                'Emoticons'                            => __( 'Emoticons' ),
     1135                'Nonbreaking space'                    => __( 'Nonbreaking space' ),
     1136                'Page break'                          => __( 'Page break' ),
     1137                'Paste as text'                        => __( 'Paste as text' ),
     1138                'Preview'                              => __( 'Preview' ),
     1139                'Print'                                => __( 'Print' ),
     1140                'Save'                                => __( 'Save' ),
     1141                'Fullscreen'                          => __( 'Fullscreen' ),
     1142                'Horizontal line'                      => __( 'Horizontal line' ),
     1143                'Horizontal space'                    => __( 'Horizontal space' ),
     1144                'Restore last draft'                  => __( 'Restore last draft' ),
     1145                'Insert/edit link'                    => array( __( 'Insert/edit link' ), 'metaK' ),
     1146                'Remove link'                          => array( __( 'Remove link' ), 'accessS' ),
     1147
     1148                // Link plugin
     1149                'Link'                                => __( 'Link' ),
     1150                'Insert link'                          => __( 'Insert link' ),
     1151                'Insert/edit link'                    => __( 'Insert/edit link' ),
     1152                'Target'                              => __( 'Target' ),
     1153                'New window'                          => __( 'New window' ),
     1154                'Text to display'                      => __( 'Text to display' ),
     1155                'Url'                                  => __( 'URL' ),
     1156                'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' =>
     1157                    __( 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?' ),
     1158                'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' =>
     1159                    __( 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?' ),
     1160
     1161                'Color'                                => __( 'Color' ),
     1162                'Custom color'                        => __( 'Custom color' ),
     1163                'Custom...'                            => _x( 'Custom...', 'label for custom color' ), // no ellipsis
     1164                'No color'                            => __( 'No color' ),
     1165                'R'                                    => _x( 'R', 'Short for red in RGB' ),
     1166                'G'                                    => _x( 'G', 'Short for green in RGB' ),
     1167                'B'                                    => _x( 'B', 'Short for blue in RGB' ),
     1168
     1169                // Spelling, search/replace plugins
     1170                'Could not find the specified string.' => __( 'Could not find the specified string.' ),
     1171                'Replace'                              => _x( 'Replace', 'find/replace' ),
     1172                'Next'                                => _x( 'Next', 'find/replace' ),
     1173                /* translators: previous */
     1174                'Prev'                                => _x( 'Prev', 'find/replace' ),
     1175                'Whole words'                          => _x( 'Whole words', 'find/replace' ),
     1176                'Find and replace'                    => __( 'Find and replace' ),
     1177                'Replace with'                         => _x( 'Replace with', 'find/replace' ),
     1178                'Find'                                => _x( 'Find', 'find/replace' ),
     1179                'Replace all'                          => _x( 'Replace all', 'find/replace' ),
     1180                'Match case'                          => __( 'Match case' ),
     1181                'Spellcheck'                          => __( 'Check Spelling' ),
     1182                'Finish'                              => _x( 'Finish', 'spellcheck' ),
     1183                'Ignore all'                          => _x( 'Ignore all', 'spellcheck' ),
     1184                'Ignore'                              => _x( 'Ignore', 'spellcheck' ),
     1185                'Add to Dictionary'                    => __( 'Add to Dictionary' ),
     1186
     1187                // TinyMCE tables
     1188                'Insert table'                        => __( 'Insert table' ),
     1189                'Delete table'                        => __( 'Delete table' ),
     1190                'Table properties'                    => __( 'Table properties' ),
     1191                'Row properties'                      => __( 'Table row properties' ),
     1192                'Cell properties'                      => __( 'Table cell properties' ),
     1193                'Border color'                        => __( 'Border color' ),
     1194
     1195                'Row'                                  => __( 'Row' ),
     1196                'Rows'                                => __( 'Rows' ),
     1197                'Column'                              => _x( 'Column', 'table column' ),
     1198                'Cols'                                => _x( 'Cols', 'table columns' ),
     1199                'Cell'                                => _x( 'Cell', 'table cell' ),
     1200                'Header cell'                          => __( 'Header cell' ),
     1201                'Header'                              => _x( 'Header', 'table header' ),
     1202                'Body'                                => _x( 'Body', 'table body' ),
     1203                'Footer'                              => _x( 'Footer', 'table footer' ),
     1204
     1205                'Insert row before'                    => __( 'Insert row before' ),
     1206                'Insert row after'                    => __( 'Insert row after' ),
     1207                'Insert column before'                => __( 'Insert column before' ),
     1208                'Insert column after'                  => __( 'Insert column after' ),
     1209                'Paste row before'                    => __( 'Paste table row before' ),
     1210                'Paste row after'                      => __( 'Paste table row after' ),
     1211                'Delete row'                          => __( 'Delete row' ),
     1212                'Delete column'                        => __( 'Delete column' ),
     1213                'Cut row'                              => __( 'Cut table row' ),
     1214                'Copy row'                            => __( 'Copy table row' ),
     1215                'Merge cells'                          => __( 'Merge table cells' ),
     1216                'Split cell'                          => __( 'Split table cell' ),
     1217
     1218                'Height'                              => __( 'Height' ),
     1219                'Width'                                => __( 'Width' ),
     1220                'Caption'                              => __( 'Caption' ),
     1221                'Alignment'                            => __( 'Alignment' ),
     1222                'H Align'                              => _x( 'H Align', 'horizontal table cell alignment' ),
     1223                'Left'                                => __( 'Left' ),
     1224                'Center'                              => __( 'Center' ),
     1225                'Right'                                => __( 'Right' ),
     1226                'None'                                => _x( 'None', 'table cell alignment attribute' ),
     1227                'V Align'                              => _x( 'V Align', 'vertical table cell alignment' ),
     1228                'Top'                                  => __( 'Top' ),
     1229                'Middle'                              => __( 'Middle' ),
     1230                'Bottom'                              => __( 'Bottom' ),
     1231
     1232                'Row group'                            => __( 'Row group' ),
     1233                'Column group'                        => __( 'Column group' ),
     1234                'Row type'                            => __( 'Row type' ),
     1235                'Cell type'                            => __( 'Cell type' ),
     1236                'Cell padding'                        => __( 'Cell padding' ),
     1237                'Cell spacing'                        => __( 'Cell spacing' ),
     1238                'Scope'                                => _x( 'Scope', 'table cell scope attribute' ),
     1239
     1240                'Insert template'                      => _x( 'Insert template', 'TinyMCE' ),
     1241                'Templates'                            => _x( 'Templates', 'TinyMCE' ),
     1242
     1243                'Background color'                    => __( 'Background color' ),
     1244                'Text color'                          => __( 'Text color' ),
     1245                'Show blocks'                          => _x( 'Show blocks', 'editor button' ),
     1246                'Show invisible characters'            => __( 'Show invisible characters' ),
     1247
     1248                /* translators: word count */
     1249                'Words: {0}'                          => sprintf( __( 'Words: %s' ), '{0}' ),
     1250                'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' =>
     1251                    __( 'Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.' ) . "\n\n" .
     1252                    __( 'If you&#8217;re looking to paste rich content from Microsoft Word, try turning this option off. The editor will clean up text pasted from Word automatically.' ),
     1253                'Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help' =>
     1254                    __( 'Rich Text Area. Press Alt-Shift-H for help.' ),
     1255                'Rich Text Area. Press Control-Option-H for help.' => __( 'Rich Text Area. Press Control-Option-H for help.' ),
     1256                'You have unsaved changes are you sure you want to navigate away?' =>
     1257                    __( 'The changes you made will be lost if you navigate away from this page.' ),
     1258                'Your browser doesn\'t support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.' =>
     1259                    __( 'Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser&#8217;s edit menu instead.' ),
     1260
     1261                // TinyMCE menus
     1262                'Insert'                              => _x( 'Insert', 'TinyMCE menu' ),
     1263                'File'                                => _x( 'File', 'TinyMCE menu' ),
     1264                'Edit'                                => _x( 'Edit', 'TinyMCE menu' ),
     1265                'Tools'                                => _x( 'Tools', 'TinyMCE menu' ),
     1266                'View'                                => _x( 'View', 'TinyMCE menu' ),
     1267                'Table'                                => _x( 'Table', 'TinyMCE menu' ),
     1268                'Format'                              => _x( 'Format', 'TinyMCE menu' ),
     1269
     1270                // WordPress strings
     1271                'Toolbar Toggle'                      => array( __( 'Toolbar Toggle' ), 'accessZ' ),
     1272                'Insert Read More tag'                => array( __( 'Insert Read More tag' ), 'accessT' ),
     1273                'Insert Page Break tag'                => array( __( 'Insert Page Break tag' ), 'accessP' ),
     1274                'Read more...'                        => __( 'Read more...' ), // Title on the placeholder inside the editor (no ellipsis)
     1275                'Distraction-free writing mode'        => array( __( 'Distraction-free writing mode' ), 'accessW' ),
     1276                'No alignment'                        => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar
     1277                'Remove'                              => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar
     1278                'Edit '                                => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar
     1279                'Paste URL or type to search'          => __( 'Paste URL or type to search' ), // Placeholder for the inline link dialog
     1280                'Apply'                                => __( 'Apply' ), // Tooltip for the 'apply' button in the inline link dialog
     1281                'Link options'                         => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog
     1282                'Visual'                              => _x( 'Visual', 'Name for the Visual editor tab' ), // Editor switch tab label
     1283                'Text'                                => _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ), // Editor switch tab label
     1284
     1285                // Shortcuts help modal
     1286                'Keyboard Shortcuts'                  => array( __( 'Keyboard Shortcuts' ), 'accessH' ),
     1287                'Default shortcuts,'                  => __( 'Default shortcuts,' ),
     1288                'Additional shortcuts,'                => __( 'Additional shortcuts,' ),
     1289                'Focus shortcuts:'                    => __( 'Focus shortcuts:' ),
     1290                'Inline toolbar (when an image, link or preview is selected)' => __( 'Inline toolbar (when an image, link or preview is selected)' ),
     1291                'Editor menu (when enabled)'          => __( 'Editor menu (when enabled)' ),
     1292                'Editor toolbar'                      => __( 'Editor toolbar' ),
     1293                'Elements path'                        => __( 'Elements path' ),
     1294                'Ctrl + Alt + letter:'                => __( 'Ctrl + Alt + letter:' ),
     1295                'Shift + Alt + letter:'                => __( 'Shift + Alt + letter:' ),
     1296                'Cmd + letter:'                        => __( 'Cmd + letter:' ),
     1297                'Ctrl + letter:'                      => __( 'Ctrl + letter:' ),
     1298                'Letter'                              => __( 'Letter' ),
     1299                'Action'                              => __( 'Action' ),
     1300                'Warning: the link has been inserted but may have errors. Please test it.' => __( 'Warning: the link has been inserted but may have errors. Please test it.' ),
     1301                'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' =>
     1302                    __( 'To move focus to other buttons use Tab or the arrow keys. To return focus to the editor press Escape or use one of the buttons.' ),
     1303                'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' =>
     1304                    __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ),
     1305                'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' =>
     1306                    __( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ),
     1307                'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' =>
     1308                    __( 'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' ),
    12901309            );
    12911310        }
     
    13341353        foreach ( $mce_translation as $name => $value ) {
    13351354            if ( is_array( $value ) ) {
    1336                 $mce_translation[$name] = $value[0];
     1355                $mce_translation[ $name ] = $value[0];
    13371356            }
    13381357        }
     
    13511370            // Remove strings that are not translated.
    13521371            if ( $key === $value ) {
    1353                 unset( $mce_translation[$key] );
     1372                unset( $mce_translation[ $key ] );
    13541373                continue;
    13551374            }
    13561375
    13571376            if ( false !== strpos( $value, '&' ) ) {
    1358                 $mce_translation[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
     1377                $mce_translation[ $key ] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );
    13591378            }
    13601379        }
     
    13981417        }
    13991418
    1400         $suffix = SCRIPT_DEBUG ? '' : '.min';
     1419        $suffix  = SCRIPT_DEBUG ? '' : '.min';
    14011420        $version = 'ver=' . $tinymce_version;
    14021421        $baseurl = self::get_baseurl();
    14031422
    1404         $compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
    1405             && false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');
     1423        $compressed = $compress_scripts && $concatenate_scripts && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] )
     1424            && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' );
    14061425
    14071426        // Load tinymce.js when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG)
     
    14321451        if ( $tmce_on ) {
    14331452            foreach ( self::$mce_settings as $editor_id => $init ) {
    1434                 $options = self::_parse_init( $init );
     1453                $options  = self::_parse_init( $init );
    14351454                $mceInit .= "'$editor_id':{$options},";
    14361455            }
     
    14511470
    14521471        $ref = array(
    1453             'plugins' => implode( ',', self::$plugins ),
    1454             'theme' => 'modern',
    1455             'language' => self::$mce_locale
     1472            'plugins'  => implode( ',', self::$plugins ),
     1473            'theme'    => 'modern',
     1474            'language' => self::$mce_locale,
    14561475        );
    14571476
    1458         $suffix = SCRIPT_DEBUG ? '' : '.min';
     1477        $suffix  = SCRIPT_DEBUG ? '' : '.min';
    14591478        $baseurl = self::get_baseurl();
    14601479        $version = 'ver=' . $tinymce_version;
     
    15121531        <?php
    15131532
    1514         if ( self::$ext_plugins )
     1533        if ( self::$ext_plugins ) {
    15151534            echo self::$ext_plugins . "\n";
    1516 
    1517         if ( ! is_admin() )
     1535        }
     1536
     1537        if ( ! is_admin() ) {
    15181538            echo 'var ajaxurl = "' . admin_url( 'admin-ajax.php', 'relative' ) . '";';
     1539        }
    15191540
    15201541        ?>
     
    15921613     */
    15931614    public static function wp_link_query( $args = array() ) {
    1594         $pts = get_post_types( array( 'public' => true ), 'objects' );
     1615        $pts      = get_post_types( array( 'public' => true ), 'objects' );
    15951616        $pt_names = array_keys( $pts );
    15961617
    15971618        $query = array(
    1598             'post_type' => $pt_names,
    1599             'suppress_filters' => true,
     1619            'post_type'              => $pt_names,
     1620            'suppress_filters'       => true,
    16001621            'update_post_term_cache' => false,
    16011622            'update_post_meta_cache' => false,
    1602             'post_status' => 'publish',
    1603             'posts_per_page' => 20,
     1623            'post_status'            => 'publish',
     1624            'posts_per_page'         => 20,
    16041625        );
    16051626
    16061627        $args['pagenum'] = isset( $args['pagenum'] ) ? absint( $args['pagenum'] ) : 1;
    16071628
    1608         if ( isset( $args['s'] ) )
     1629        if ( isset( $args['s'] ) ) {
    16091630            $query['s'] = $args['s'];
     1631        }
    16101632
    16111633        $query['offset'] = $args['pagenum'] > 1 ? $query['posts_per_page'] * ( $args['pagenum'] - 1 ) : 0;
     
    16261648        // Do main query.
    16271649        $get_posts = new WP_Query;
    1628         $posts = $get_posts->query( $query );
     1650        $posts     = $get_posts->query( $query );
    16291651
    16301652        // Build results.
    16311653        $results = array();
    16321654        foreach ( $posts as $post ) {
    1633             if ( 'post' == $post->post_type )
     1655            if ( 'post' == $post->post_type ) {
    16341656                $info = mysql2date( __( 'Y/m/d' ), $post->post_date );
    1635             else
     1657            } else {
    16361658                $info = $pts[ $post->post_type ]->labels->singular_name;
     1659            }
    16371660
    16381661            $results[] = array(
    1639                 'ID' => $post->ID,
    1640                 'title' => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
     1662                'ID'        => $post->ID,
     1663                'title'     => trim( esc_html( strip_tags( get_the_title( $post ) ) ) ),
    16411664                'permalink' => get_permalink( $post->ID ),
    1642                 'info' => $info,
     1665                'info'      => $info,
    16431666            );
    16441667        }
     
    16921715        <form id="wp-link" tabindex="-1">
    16931716        <?php wp_nonce_field( 'internal-linking', '_ajax_linking_nonce', false ); ?>
    1694         <h1 id="link-modal-title"><?php _e( 'Insert/edit link' ) ?></h1>
     1717        <h1 id="link-modal-title"><?php _e( 'Insert/edit link' ); ?></h1>
    16951718        <button type="button" id="wp-link-close"><span class="screen-reader-text"><?php _e( 'Close' ); ?></span></button>
    16961719        <div id="link-selector">
     
    17341757                        <span class="spinner"></span>
    17351758                    </div>
    1736                 </div>
    1737             </div>
     1759                 </div>
     1760             </div>
    17381761        </div>
    17391762        <div class="submitbox">
Note: See TracChangeset for help on using the changeset viewer.