Title: _WP_Editors::force_uncompressed_tinymce
Published: December 6, 2018
Last modified: May 20, 2026

---

# _WP_Editors::force_uncompressed_tinymce()

## In this article

 * [Description](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#description)
 * [Source](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#wp--skip-link--target)

Force uncompressed TinyMCE when a custom theme has been defined.

## 󠀁[Description](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#description)󠁿

The compressed TinyMCE file cannot deal with custom themes, so this makes sure that
WordPress uses the uncompressed TinyMCE file if a theme is defined.
Even if the 
website is running on a production environment.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#source)󠁿

    ```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 );
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-editor.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-editor.php#L1525)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-editor.php#L1525-L1542)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_register_tinymce_scripts()](https://developer.wordpress.org/reference/functions/wp_register_tinymce_scripts/)`wp-includes/script-loader.php` |

Registers TinyMCE scripts.

  | 
| [wp_scripts()](https://developer.wordpress.org/reference/functions/wp_scripts/)`wp-includes/functions.wp-scripts.php` |

Initializes $wp_scripts if it has not been set.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/_wp_editors/force_uncompressed_tinymce/?output_format=md#changelog)󠁿

| Version | Description | 
| [5.0.0](https://developer.wordpress.org/reference/since/5.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2F_wp_editors%2Fforce_uncompressed_tinymce%2F)
before being able to contribute a note or feedback.