mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-05-18 18:24:39 +00:00
TinyMCE: retire wp-tinymce.php and remove pre-compression of wp-tinymce.js.
Fixes #45645. git-svn-id: https://develop.svn.wordpress.org/trunk@44651 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
12
src/js/_enqueues/vendor/tinymce/wp-tinymce.php
vendored
12
src/js/_enqueues/vendor/tinymce/wp-tinymce.php
vendored
@@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Not used in core since 5.1.
|
||||
* This is a back-compat for plugins that may be using this method of loading directly.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable error reporting
|
||||
*
|
||||
@@ -28,13 +33,10 @@ header( 'Vary: Accept-Encoding' ); // Handle proxies
|
||||
header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', time() + $expires_offset ) . ' GMT' );
|
||||
header( "Cache-Control: public, max-age=$expires_offset" );
|
||||
|
||||
if ( isset( $_GET['c'] ) && 1 == $_GET['c'] && isset( $_SERVER['HTTP_ACCEPT_ENCODING'] )
|
||||
&& false !== stripos( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) && ( $file = get_file( $basepath . '/wp-tinymce.js.gz' ) ) ) {
|
||||
|
||||
header( 'Content-Encoding: gzip' );
|
||||
if ( isset( $_GET['c'] ) && ( $file = get_file( $basepath . '/wp-tinymce.js' ) ) ) {
|
||||
echo $file;
|
||||
} else {
|
||||
// Back compat. This file shouldn't be used if this condition can occur (as in, if gzip isn't accepted).
|
||||
// Even further back compat.
|
||||
echo get_file( $basepath . '/tinymce.min.js' );
|
||||
echo get_file( $basepath . '/plugins/compat3x/plugin.min.js' );
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ function wp_register_tinymce_scripts( &$scripts, $force_uncompressed = false ) {
|
||||
// Load tinymce.js when running from /src, otherwise load wp-tinymce.js.gz (in production) or
|
||||
// tinymce.min.js (when SCRIPT_DEBUG is true).
|
||||
if ( $compressed ) {
|
||||
$scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.php', array(), $tinymce_version );
|
||||
$scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . 'wp-tinymce.js', array(), $tinymce_version );
|
||||
} else {
|
||||
$scripts->add( 'wp-tinymce-root', includes_url( 'js/tinymce/' ) . "tinymce$dev_suffix.js", array(), $tinymce_version );
|
||||
$scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . "plugins/compat3x/plugin$dev_suffix.js", array( 'wp-tinymce-root' ), $tinymce_version );
|
||||
|
||||
Reference in New Issue
Block a user