Sul lavoro, finora, non avevo mai usato Gutenberg, l’editor a blocchi di WordPress; finalmente dalla settimana scorsa sto lavorando a un progetto che lo prevede.
Tutto bene, non fosse per alcuni dettagli: tipo che il popup dei tips e la modalità a schermo intero tornano su come un rigurgito se osi pulire la cache.
Non entro nella (lunga) discussione in merito, dico solo: c’è un modo per stroncare questo simpatico comportamento.

Prego.

add_action( 'wp_dashboard_setup', 'wporg_remove_gutenberg_panel' );

/**
 * Removes the very annoying Try Gutenberg Panel.
 */
function wporg_remove_gutenberg_panel() {
remove_action( 'try_gutenberg_panel', 'wp_try_gutenberg_panel' );
}

add_action( 'admin_head', 'wporg_remove_gutenberg_tips' );

/**
 * Hides the very annoying Welcome Tips popup for Gutenberg.
 */
function wporg_remove_gutenberg_tips() {
?>
    <style>
        .components-modal__frame.components-guide {
            display: none !important;
        }

        .components-modal__screen-overlay {
            display: none !important;
        }
    </style>
<?php
}

add_action( 'enqueue_block_editor_assets', 'wporg_disable_editor_fullscreen' );

/**
 * Disable the very annoying fullscreen mode for Gutenberg.
 */
function wporg_disable_editor_fullscreen() {
$script = "window.onload = function() { const isFullscreenMode = wp.data.select( 'core/edit-post' ).isFeatureActive( 'fullscreenModè ); if ( isFullscreenMode ) { wp.data.dispatch( 'core/edit-post' ).toggleFeature( 'fullscreenModè ); } }";
wp_add_inline_script( 'wp-blocks', $script );
}