Edit File by line
/home/barbar84/www/wp-conte.../themes/twentytw.../assets/js
File: editor.js
/* global setTimeout */
[0] Fix | Delete
wp.domReady( function() {
[1] Fix | Delete
// Unregister "Wide" Separator Style.
[2] Fix | Delete
wp.blocks.unregisterBlockStyle( 'core/separator', 'wide' );
[3] Fix | Delete
[4] Fix | Delete
// Add to ".block-editor__typewriter" the "is-dark-theme" class if needed.
[5] Fix | Delete
function twentytwentyoneCopyDarkThemeClass() {
[6] Fix | Delete
var editor,
[7] Fix | Delete
attemptDelay = 25,
[8] Fix | Delete
attempt = 0,
[9] Fix | Delete
maxAttempts = 10;
[10] Fix | Delete
[11] Fix | Delete
if ( ! document.body.classList.contains( 'is-dark-theme' ) ) {
[12] Fix | Delete
return;
[13] Fix | Delete
}
[14] Fix | Delete
[15] Fix | Delete
editor = document.querySelector( '.block-editor__typewriter' );
[16] Fix | Delete
if ( null === editor ) {
[17] Fix | Delete
// Try again.
[18] Fix | Delete
if ( attempt < maxAttempts ) {
[19] Fix | Delete
setTimeout( function() {
[20] Fix | Delete
twentytwentyoneCopyDarkThemeClass();
[21] Fix | Delete
}, attemptDelay );
[22] Fix | Delete
[23] Fix | Delete
// Increment the attempts counter.
[24] Fix | Delete
attempt++;
[25] Fix | Delete
[26] Fix | Delete
// Double the delay, give the server some time to breathe.
[27] Fix | Delete
attemptDelay *= 2;
[28] Fix | Delete
}
[29] Fix | Delete
return;
[30] Fix | Delete
}
[31] Fix | Delete
[32] Fix | Delete
editor.classList.add( 'is-dark-theme' );
[33] Fix | Delete
}
[34] Fix | Delete
[35] Fix | Delete
twentytwentyoneCopyDarkThemeClass();
[36] Fix | Delete
} );
[37] Fix | Delete
[38] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function