Skip to content

Instantly share code, notes, and snippets.

function custom_theme_assets() {
// bail if classic editor setting is set to block or no-replace
$option = get_option( 'classic-editor-replace' );
if ( $option === 'block' || $option === 'no-replace' ) {
return;
}
// bail if classic editor plugin is not active. can't use is_plugin_active() here, unless you include wp-admin/includes/plugin.php
if ( ! in_array( 'classic-editor/classic-editor.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
return;