: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
editor.addCommand( 'wpToggleDFW', toggle );
editor.addShortcut( 'access+w', '', 'wpToggleDFW' );
* Binds and unbinds events on the editor.
* @param {event} event The TinyMCE editor init event.
* @param {object} editor The editor to bind events on.
$document.on( 'tinymce-editor-init.focus', function( event, editor ) {
if ( editor.id === 'content' ) {
$editorWindow = $( editor.getWin() );
$editorIframe = $( editor.getContentAreaContainer() ).find( 'iframe' );
editor.on( 'keydown', fadeOut );
editor.on( 'blur', maybeFadeIn );
editor.on( 'focus', focus );
editor.on( 'blur', blur );
editor.on( 'wp-autoresize', recalcEditorRect );
editor.off( 'keydown', fadeOut );
editor.off( 'blur', maybeFadeIn );
editor.off( 'focus', focus );
editor.off( 'blur', blur );
editor.off( 'wp-autoresize', recalcEditorRect );
// Bind and unbind based on the distraction free writing focus.
$document.on( 'dfw-on.focus', mceBind ).on( 'dfw-off.focus', mceUnbind );
// Focus the editor when it is the target of the click event.
editor.on( 'click', function( event ) {
if ( event.target === editor.getDoc().documentElement ) {
* Binds events on quicktags init.
* @param {event} event The quicktags init event.
* @param {object} editor The editor to bind events on.
$document.on( 'quicktags-init', function( event, editor ) {
// Bind the distraction free writing events if the distraction free writing button is available.
if ( editor.settings.buttons && ( ',' + editor.settings.buttons + ',' ).indexOf( ',dfw,' ) !== -1 ) {
$button = $( '#' + editor.name + '_dfw' );
.on( 'dfw-activate', function() {
$button.prop( 'disabled', false );
.on( 'dfw-deactivate', function() {
$button.prop( 'disabled', true );
.on( 'dfw-on', function() {
$button.addClass( 'active' );
.on( 'dfw-off', function() {
$button.removeClass( 'active' );
$document.on( 'editor-expand-on.focus', activate ).on( 'editor-expand-off.focus', deactivate );
$content.on( 'keydown.focus', fadeOut );
$title.add( $content ).on( 'blur.focus', maybeFadeIn );
window.wp = window.wp || {};
window.wp.editor = window.wp.editor || {};
} )( window, window.jQuery );