Changeset 44115 for trunk/src/wp-includes/class-wp-editor.php
- Timestamp:
- 12/13/2018 05:26:09 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43738
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/class-wp-editor.php
r43571 r44115 318 318 if ( is_admin() ) { 319 319 add_action( 'admin_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 ); 320 add_action( 'admin_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 ); 320 321 add_action( 'admin_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 ); 321 322 } else { 322 323 add_action( 'wp_print_footer_scripts', array( __CLASS__, 'editor_js' ), 50 ); 324 add_action( 'wp_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 ); 323 325 add_action( 'wp_print_footer_scripts', array( __CLASS__, 'enqueue_scripts' ), 1 ); 324 326 } … … 756 758 757 759 /** 760 * 761 * @static 762 * 758 763 * @param bool $default_scripts Optional. Whether default scripts should be enqueued. Default false. 759 764 */ … … 820 825 821 826 if ( is_admin() ) { 827 add_action( 'admin_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 ); 822 828 add_action( 'admin_print_footer_scripts', array( __CLASS__, 'print_default_editor_scripts' ), 45 ); 823 829 } else { 830 add_action( 'wp_print_footer_scripts', array( __CLASS__, 'force_uncompressed_tinymce' ), 1 ); 824 831 add_action( 'wp_print_footer_scripts', array( __CLASS__, 'print_default_editor_scripts' ), 45 ); 825 832 } … … 1389 1396 1390 1397 /** 1398 * Force uncompressed TinyMCE when a custom theme has been defined. 1399 * 1400 * The compressed TinyMCE file cannot deal with custom themes, so this makes 1401 * sure that we use the uncompressed TinyMCE file if a theme is defined. 1402 * Even if we are on a production environment. 1403 */ 1404 public static function force_uncompressed_tinymce() { 1405 $has_custom_theme = false; 1406 foreach ( self::$mce_settings as $init ) { 1407 if ( ! empty( $init['theme_url'] ) ) { 1408 $has_custom_theme = true; 1409 break; 1410 } 1411 } 1412 1413 if ( ! $has_custom_theme ) { 1414 return; 1415 } 1416 1417 $wp_scripts = wp_scripts(); 1418 1419 $wp_scripts->remove( 'wp-tinymce' ); 1420 wp_register_tinymce_scripts( $wp_scripts, true ); 1421 } 1422 1423 /** 1391 1424 * Print (output) the main TinyMCE scripts. 1392 1425 * … … 1398 1431 */ 1399 1432 public static function print_tinymce_scripts() { 1400 global $ tinymce_version, $concatenate_scripts, $compress_scripts;1433 global $concatenate_scripts; 1401 1434 1402 1435 if ( self::$tinymce_scripts_printed ) { … … 1409 1442 script_concat_settings(); 1410 1443 } 1411 1412 $suffix = SCRIPT_DEBUG ? '' : '.min';1413 $version = 'ver=' . $tinymce_version;1414 $baseurl = self::get_baseurl();1415 1416 $has_custom_theme = false;1417 foreach ( self::$mce_settings as $init ) {1418 if ( ! empty( $init['theme_url'] ) ) {1419 $has_custom_theme = true;1420 break;1421 }1422 }1423 1424 $compressed = $compress_scripts && $concatenate_scripts && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] )1425 && false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ! $has_custom_theme;1426 1427 // Load tinymce.js when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG)1428 $mce_suffix = false !== strpos( get_bloginfo( 'version' ), '-src' ) ? '' : '.min';1429 1430 if ( $compressed ) {1431 echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&$version'></script>\n";1432 } else {1433 echo "<script type='text/javascript' src='{$baseurl}/tinymce{$mce_suffix}.js?$version'></script>\n";1434 echo "<script type='text/javascript' src='{$baseurl}/plugins/compat3x/plugin{$suffix}.js?$version'></script>\n";1435 }1436 1437 echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";1438 1444 } 1439 1445
Note: See TracChangeset
for help on using the changeset viewer.