Editor: fix the replacement of wp.editor with wp.oldEditor in the inline script outputted when enqueueing the old editor.

Props fullofcaffeine, davidbinda, grantmkin, get_dave, azaozz.
Merges [51748] to the 5.8 branch.
Fixes #53762.

git-svn-id: https://develop.svn.wordpress.org/branches/5.8@51749 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-09-08 19:23:39 +00:00
parent 3fa8b55ad6
commit bd3f727f50

View File

@ -969,8 +969,12 @@ final class _WP_Editors {
?>
<script type="text/javascript">
window.wp = window.wp || {};
window.wp.editor = window.wp.oldEditor = window.wp.oldEditor || {};
window.wp.oldEditor.getDefaultSettings = function() {
window.wp.editor = window.wp.editor || {};
window.wp.oldEditor = window.wp.oldEditor || {};
// Add getDefaultSettings() to both wp.editor and wp.oldEditor for back compat.
// Use of wp.editor for "old editor" functionality should be deprecated.
window.wp.editor.getDefaultSettings = window.wp.oldEditor.getDefaultSettings = function() {
return {
tinymce: <?php echo $settings; ?>,
quicktags: {