You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could we add to instructions both examples of how to disable the Block Directory from a plugin and a theme? Otherwise, people might not know that they should use a different hook than 'plugins_loaded' when disabling the Block Directory from a theme. Thank you.
Could we add to instructions both examples of how to disable the Block Directory from a plugin and a theme? Otherwise, people might not know that they should use a different hook than 'plugins_loaded' when disabling the Block Directory from a theme. Thank you.
From a plugin:
/**
*/
add_action('plugins_loaded', 'myplugin_disable_block_directory');
function myplugin_disable_block_directory()
{
remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
remove_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' );
};
From a theme:
/**
*/
add_action('admin_init', 'mytheme_disable_block_directory');
function mytheme_disable_block_directory()
{
remove_action( 'enqueue_block_editor_assets', 'wp_enqueue_editor_block_directory_assets' );
remove_action( 'enqueue_block_editor_assets', 'gutenberg_enqueue_block_editor_assets_block_directory' );
};
The text was updated successfully, but these errors were encountered: