Script loading: Fix regression after [43738].

After [43738], TinyMCE would be loaded earlier than before, which makes filters run at a different time relative to the loading of TinyMCE. Fix this by calling `wp_print_scripts` at the location where TinyMCE would previously be inserted as a `<script>` tag in the page.

Also, an TinyMCE translation related `<script>` that was mistakenly removed in [44115].

Props azaozz, omarreiss, swisspidy, atimmer.

Merges [43753], [43754] to trunk.

Fixes #45065.

git-svn-id: https://develop.svn.wordpress.org/trunk@44119 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers 2018-12-13 19:18:58 +00:00
parent 93091fac36
commit 26c034a044
2 changed files with 5 additions and 1 deletions

View File

@ -1441,6 +1441,10 @@ final class _WP_Editors {
if ( ! isset( $concatenate_scripts ) ) {
script_concat_settings();
}
wp_print_scripts( array( 'wp-tinymce' ) );
echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";
}
/**

View File

@ -684,7 +684,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'colorpicker', "/wp-includes/js/colorpicker$suffix.js", array( 'prototype' ), '3517m' );
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array( 'wp-tinymce', 'utils', 'jquery' ), false, 1 );
$scripts->add( 'editor', "/wp-admin/js/editor$suffix.js", array( 'utils', 'jquery' ), false, 1 );
// Back-compat for old DFW. To-do: remove at the end of 2016.
$scripts->add( 'wp-fullscreen-stub', "/wp-admin/js/wp-fullscreen-stub$suffix.js", array(), false, 1 );