_WP_Editors::force_uncompressed_tinymce() WordPress Method

The WP_Editors::force_uncompressed_tinymce() method is used to force the use of the uncompressed version of TinyMCE. This is useful for debugging purposes.

_WP_Editors::force_uncompressed_tinymce() #

Force uncompressed TinyMCE when a custom theme has been defined.


Description

The compressed TinyMCE file cannot deal with custom themes, so this makes sure that we use the uncompressed TinyMCE file if a theme is defined. Even if we are on a production environment.


Top ↑

Source

File: wp-includes/class-wp-editor.php

	public static function force_uncompressed_tinymce() {
		$has_custom_theme = false;
		foreach ( self::$mce_settings as $init ) {
			if ( ! empty( $init['theme_url'] ) ) {
				$has_custom_theme = true;
				break;
			}
		}

		if ( ! $has_custom_theme ) {
			return;
		}

		$wp_scripts = wp_scripts();

		$wp_scripts->remove( 'wp-tinymce' );
		wp_register_tinymce_scripts( $wp_scripts, true );
	}


Top ↑

Changelog

Changelog
VersionDescription
5.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.