wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



remove_editor_styles › WordPress Function

Seit3.1.0
Veraltetn/v
› remove_editor_styles ( Keine Parameter )
Gibt zurück:
  • (bool) True on success, false if there were no stylesheets to remove.
Definiert in:
Codex:

Removes all visual editor stylesheets.

Internally this removes the 'editor-style' (singular) theme support added by add_editor_style(). In the admin, it also clears the registered stylesheets, so they are no longer loaded in either the classic/TinyMCE or the block editor. The plural form, 'editor-styles', is a separate theme support and is not affected by this function. To remove it, use remove_theme_support( 'editor-styles' ).


Quellcode

function remove_editor_styles() {
	if ( ! current_theme_supports( 'editor-style' ) ) {
		return false;
	}
	_remove_theme_support( 'editor-style' );
	if ( is_admin() ) {
		$GLOBALS['editor_styles'] = array();
	}
	return true;
}