Changeset 47122 for trunk/src/wp-includes/class-wp-editor.php
- Timestamp:
- 01/29/2020 12:43:23 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-editor.php
r47060 r47122 294 294 } 295 295 296 // Back-compat for the `htmledit_pre` and `richedit_pre` filters 296 // Back-compat for the `htmledit_pre` and `richedit_pre` filters. 297 297 if ( 'html' === $default_editor && has_filter( 'htmledit_pre' ) ) { 298 298 /** This filter is documented in wp-includes/deprecated.php */ … … 515 515 $strings = ''; 516 516 517 // Try to load langs/[locale].js and langs/[locale]_dlg.js 517 // Try to load langs/[locale].js and langs/[locale]_dlg.js. 518 518 if ( ! in_array( $name, $loaded_langs, true ) ) { 519 519 $path = str_replace( content_url(), '', $plugurl ); … … 569 569 $mce_css = $settings['content_css']; 570 570 571 // The `editor-style.css` added by the theme is generally intended for the editor instance on the Edit Post screen. 572 // Plugins that use wp_editor() on the front-end can decide whether to add the theme stylesheet 573 // by using `get_editor_stylesheets()` and the `mce_css` or `tiny_mce_before_init` filters, see below. 571 /* 572 * The `editor-style.css` added by the theme is generally intended for the editor instance on the Edit Post screen. 573 * Plugins that use wp_editor() on the front-end can decide whether to add the theme stylesheet 574 * by using `get_editor_stylesheets()` and the `mce_css` or `tiny_mce_before_init` filters, see below. 575 */ 574 576 if ( is_admin() ) { 575 577 $editor_styles = get_editor_stylesheets(); … … 772 774 ); 773 775 774 // Merge with the first part of the init array 776 // Merge with the first part of the init array. 775 777 $mceInit = array_merge( self::$first_init, $mceInit ); 776 778 … … 820 822 821 823 self::$mce_settings[ $editor_id ] = $mceInit; 822 } // end if self::$this_tinymce824 } // End if self::$this_tinymce. 823 825 } 824 826 … … 914 916 self::enqueue_scripts( true ); 915 917 916 // Also add wp-includes/css/editor.css 918 // Also add wp-includes/css/editor.css. 917 919 wp_enqueue_style( 'editor-buttons' ); 918 920 … … 947 949 } 948 950 949 // In production all plugins are loaded (they are in wp-editor.js.gz). 950 // The 'wpview', 'wpdialogs', and 'media' TinyMCE plugins are not initialized by default. 951 // Can be added from js by using the 'wp-before-tinymce-init' event. 951 /* 952 * In production all plugins are loaded (they are in wp-editor.js.gz). 953 * The 'wpview', 'wpdialogs', and 'media' TinyMCE plugins are not initialized by default. 954 * Can be added from js by using the 'wp-before-tinymce-init' event. 955 */ 952 956 $settings['plugins'] = implode( 953 957 ',', … … 1034 1038 if ( empty( self::$mce_locale ) ) { 1035 1039 $mce_locale = get_user_locale(); 1036 self::$mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1 1040 self::$mce_locale = empty( $mce_locale ) ? 'en' : strtolower( substr( $mce_locale, 0, 2 ) ); // ISO 639-1. 1037 1041 } 1038 1042 … … 1108 1112 'branding' => false, 1109 1113 1110 // Limit the preview styles in the menu/toolbar 1114 // Limit the preview styles in the menu/toolbar. 1111 1115 'preview_styles' => 'font-family font-size font-weight font-style text-decoration text-transform', 1112 1116 … … 1121 1125 $version = 'ver=' . get_bloginfo( 'version' ); 1122 1126 1123 // Default stylesheets 1127 // Default stylesheets. 1124 1128 $settings['content_css'] = includes_url( "css/dashicons$suffix.css?$version" ) . ',' . 1125 1129 includes_url( "js/tinymce/skins/wordpress/wp-content.css?$version" ); … … 1136 1140 if ( empty( self::$translation ) ) { 1137 1141 self::$translation = array( 1138 // Default TinyMCE strings 1142 // Default TinyMCE strings. 1139 1143 'New document' => __( 'New document' ), 1140 1144 'Formats' => _x( 'Formats', 'TinyMCE' ), … … 1201 1205 'Lower Roman' => _x( 'Lower Roman', 'list style' ), 1202 1206 1203 // Anchor plugin 1207 // Anchor plugin. 1204 1208 'Name' => _x( 'Name', 'Name of link anchor (TinyMCE)' ), 1205 1209 'Anchor' => _x( 'Anchor', 'Link anchor (TinyMCE)' ), … … 1209 1213 'Id' => _x( 'Id', 'Id for link anchor (TinyMCE)' ), 1210 1214 1211 // Fullpage plugin 1215 // Fullpage plugin. 1212 1216 'Document properties' => __( 'Document properties' ), 1213 1217 'Robots' => __( 'Robots' ), … … 1218 1222 'Author' => __( 'Author' ), 1219 1223 1220 // Media, image plugins 1224 // Media, image plugins. 1221 1225 'Image' => __( 'Image' ), 1222 1226 'Insert/edit image' => array( __( 'Insert/edit image' ), 'accessM' ), … … 1244 1248 'Embed' => __( 'Embed' ), 1245 1249 1246 // Each of these have a corresponding plugin 1250 // Each of these have a corresponding plugin. 1247 1251 'Special character' => __( 'Special character' ), 1248 1252 'Right to left' => _x( 'Right to left', 'editor button' ), … … 1262 1266 'Remove link' => array( __( 'Remove link' ), 'accessS' ), 1263 1267 1264 // Link plugin 1268 // Link plugin. 1265 1269 'Link' => __( 'Link' ), 1266 1270 'Insert link' => __( 'Insert link' ), … … 1276 1280 'Color' => __( 'Color' ), 1277 1281 'Custom color' => __( 'Custom color' ), 1278 'Custom...' => _x( 'Custom...', 'label for custom color' ), // no ellipsis1282 'Custom...' => _x( 'Custom...', 'label for custom color' ), // No ellipsis. 1279 1283 'No color' => __( 'No color' ), 1280 1284 'R' => _x( 'R', 'Short for red in RGB' ), … … 1282 1286 'B' => _x( 'B', 'Short for blue in RGB' ), 1283 1287 1284 // Spelling, search/replace plugins 1288 // Spelling, search/replace plugins. 1285 1289 'Could not find the specified string.' => __( 'Could not find the specified string.' ), 1286 1290 'Replace' => _x( 'Replace', 'find/replace' ), … … 1300 1304 'Add to Dictionary' => __( 'Add to Dictionary' ), 1301 1305 1302 // TinyMCE tables 1306 // TinyMCE tables. 1303 1307 'Insert table' => __( 'Insert table' ), 1304 1308 'Delete table' => __( 'Delete table' ), … … 1374 1378 __( 'Your browser does not support direct access to the clipboard. Please use keyboard shortcuts or your browser’s edit menu instead.' ), 1375 1379 1376 // TinyMCE menus 1380 // TinyMCE menus. 1377 1381 'Insert' => _x( 'Insert', 'TinyMCE menu' ), 1378 1382 'File' => _x( 'File', 'TinyMCE menu' ), … … 1383 1387 'Format' => _x( 'Format', 'TinyMCE menu' ), 1384 1388 1385 // WordPress strings 1389 // WordPress strings. 1386 1390 'Toolbar Toggle' => array( __( 'Toolbar Toggle' ), 'accessZ' ), 1387 1391 'Insert Read More tag' => array( __( 'Insert Read More tag' ), 'accessT' ), 1388 1392 'Insert Page Break tag' => array( __( 'Insert Page Break tag' ), 'accessP' ), 1389 'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor (no ellipsis) 1393 'Read more...' => __( 'Read more...' ), // Title on the placeholder inside the editor (no ellipsis). 1390 1394 'Distraction-free writing mode' => array( __( 'Distraction-free writing mode' ), 'accessW' ), 1391 'No alignment' => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar 1392 'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar1393 'Edit|button' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar1394 'Paste URL or type to search' => __( 'Paste URL or type to search' ), // Placeholder for the inline link dialog 1395 'Apply' => __( 'Apply' ), // Tooltip for the 'apply' button in the inline link dialog1396 'Link options' => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog 1397 'Visual' => _x( 'Visual', 'Name for the Visual editor tab' ), // Editor switch tab label1398 'Text' => _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ), // Editor switch tab label 1399 'Add Media' => array( __( 'Add Media' ), 'accessM' ), // Tooltip for the 'Add Media' button in the block editor Classic block 1400 1401 // Shortcuts help modal 1395 'No alignment' => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar. 1396 'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar. 1397 'Edit|button' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar. 1398 'Paste URL or type to search' => __( 'Paste URL or type to search' ), // Placeholder for the inline link dialog. 1399 'Apply' => __( 'Apply' ), // Tooltip for the 'apply' button in the inline link dialog. 1400 'Link options' => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog. 1401 'Visual' => _x( 'Visual', 'Name for the Visual editor tab' ), // Editor switch tab label. 1402 'Text' => _x( 'Text', 'Name for the Text editor tab (formerly HTML)' ), // Editor switch tab label. 1403 'Add Media' => array( __( 'Add Media' ), 'accessM' ), // Tooltip for the 'Add Media' button in the block editor Classic block. 1404 1405 // Shortcuts help modal. 1402 1406 'Keyboard Shortcuts' => array( __( 'Keyboard Shortcuts' ), 'accessH' ), 1403 1407 'Classic Block Keyboard Shortcuts' => __( 'Classic Block Keyboard Shortcuts' ), … … 1497 1501 } 1498 1502 1499 // Set direction 1503 // Set direction. 1500 1504 if ( is_rtl() ) { 1501 1505 $mce_translation['_dir'] = 'rtl'; … … 1644 1648 1645 1649 if ( self::$ext_plugins ) { 1646 // Load the old-format English strings to prevent unsightly labels in old style popups 1650 // Load the old-format English strings to prevent unsightly labels in old style popups. 1647 1651 echo "<script type='text/javascript' src='{$baseurl}/langs/wp-langs-en.js?$version'></script>\n"; 1648 1652 } … … 1829 1833 */ 1830 1834 public static function wp_link_dialog() { 1831 // Run once 1835 // Run once. 1832 1836 if ( self::$link_dialog_printed ) { 1833 1837 return; … … 1836 1840 self::$link_dialog_printed = true; 1837 1841 1838 // display: none is required here, see #WP276051842 // `display: none` is required here, see #WP27605. 1839 1843 ?> 1840 1844 <div id="wp-link-backdrop" style="display: none"></div>
Note: See TracChangeset
for help on using the changeset viewer.