Ticket #53762: 53762.3.diff
File 53762.3.diff, 2.0 KB (added by , 3 years ago) |
---|
-
src/js/_enqueues/wp/editor/base.js
5 5 window.wp = window.wp || {}; 6 6 7 7 ( function( $, wp ) { 8 wp.editor = wp.oldEditor = wp.oldEditor || {}; 8 // Back-compat for places that need the old wp.editor outside of the block editor. 9 window.wp.editor = window.wp.editor || {}; 10 window.wp.oldEditor = window.wp.oldEditor || {}; 9 11 10 12 /** 11 13 * Utility functions for the editor. … … 1191 1193 } ); 1192 1194 } 1193 1195 1194 wp. oldEditor.autop = wpautop;1195 wp. oldEditor.removep = pre_wpautop;1196 wp.editor.autop = wp.oldEditor.autop = wpautop; 1197 wp.editor.removep = wp.oldEditor.removep = pre_wpautop; 1196 1198 1197 1199 exports = { 1198 1200 go: switchEditor, … … 1241 1243 * } 1242 1244 * } 1243 1245 */ 1244 wp. oldEditor.initialize = function( id, settings ) {1246 wp.editor.initialize = wp.oldEditor.initialize = function( id, settings ) { 1245 1247 var init; 1246 1248 var defaults; 1247 1249 1248 if ( ! $ || ! id || ! wp.oldEditor.getDefaultSettings) {1250 if ( ! $ || ! id ) { 1249 1251 return; 1250 1252 } 1251 1253 1252 defaults = wp.oldEditor.getDefaultSettings(); 1254 if ( wp.oldEditor.getDefaultSettings ) { 1255 defaults = wp.oldEditor.getDefaultSettings(); 1256 } else if ( wp.editor.getDefaultSettings ) { 1257 defaults = wp.editor.getDefaultSettings(); 1258 } else { 1259 // Default settings are missing. 1260 return; 1261 } 1253 1262 1254 1263 // Initialize TinyMCE by default. 1255 1264 if ( ! settings ) { … … 1355 1364 * 1356 1365 * @param {string} id The HTML id of the editor textarea. 1357 1366 */ 1358 wp. oldEditor.remove = function( id ) {1367 wp.editor.remove = wp.oldEditor.remove = function( id ) { 1359 1368 var mceInstance, qtInstance, 1360 1369 $wrap = $( '#wp-' + id + '-wrap' ); 1361 1370 … … 1395 1404 * @param {string} id The HTML id of the editor textarea. 1396 1405 * @return The editor content. 1397 1406 */ 1398 wp. oldEditor.getContent = function( id ) {1407 wp.editor.getContent = wp.oldEditor.getContent = function( id ) { 1399 1408 var editor; 1400 1409 1401 1410 if ( ! $ || ! id ) {