_WP_Editors::print_tinymce_scripts()

Print (output) the main TinyMCE scripts.


Description Description


Source Source

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

	public static function print_tinymce_scripts() {
		global $tinymce_version, $concatenate_scripts, $compress_scripts;

		if ( self::$tinymce_scripts_printed ) {
			return;
		}

		self::$tinymce_scripts_printed = true;

		if ( ! isset( $concatenate_scripts ) ) {
			script_concat_settings();
		}

		$suffix = SCRIPT_DEBUG ? '' : '.min';
		$version = 'ver=' . $tinymce_version;
		$baseurl = self::get_baseurl();

		$compressed = $compress_scripts && $concatenate_scripts && isset($_SERVER['HTTP_ACCEPT_ENCODING'])
			&& false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip');

		// Load tinymce.js when running from /src, else load wp-tinymce.js.gz (production) or tinymce.min.js (SCRIPT_DEBUG)
		$mce_suffix = false !== strpos( get_bloginfo( 'version' ), '-src' ) ? '' : '.min';

		if ( $compressed ) {
			echo "<script type='text/javascript' src='{$baseurl}/wp-tinymce.php?c=1&amp;$version'></script>\n";
		} else {
			echo "<script type='text/javascript' src='{$baseurl}/tinymce{$mce_suffix}.js?$version'></script>\n";
			echo "<script type='text/javascript' src='{$baseurl}/plugins/compat3x/plugin{$suffix}.js?$version'></script>\n";
		}

		echo "<script type='text/javascript'>\n" . self::wp_mce_translation() . "</script>\n";
	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.8.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.