wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



wp_register_tinymce_scripts › WordPress Function

Da5.0.0
Deprecaton/a
› wp_register_tinymce_scripts ( $scripts, $deprecated = false )
Parametri: (2)
  • (WP_Scripts) $scripts WP_Scripts object.
    Richiesto: Sì
  • (bool) $deprecated Not used.
    Richiesto: No
    Default: false
Definito a:
Codex:
ChangeLog:
  • 7.2.0
  • 7.2.0

Registers TinyMCE scripts.

TinyMCE core and the compat3x plugin are registered as separate files. TinyMCE loads its theme and any other plugins itself when an editor is initialized. The wp-tinymce.js bundle of all of them is no longer registered, but it can still be registered in their place under the wp-tinymce handle.


Sorgenti

function wp_register_tinymce_scripts( $scripts, $deprecated = false ): void {
	global $tinymce_version;

	if ( false !== $deprecated ) {
		_deprecated_argument( __FUNCTION__, '7.2.0' );
	}

	$suffix     = wp_scripts_get_suffix();
	$dev_suffix = wp_scripts_get_suffix( 'dev' );

	// Load tinymce.js when running from /src, otherwise tinymce.min.js.
	$scripts->add( 'wp-tinymce-root', includes_url( 'js/tinymce/' ) . "tinymce$dev_suffix.js", array(), $tinymce_version );
	$scripts->add( 'wp-tinymce', includes_url( 'js/tinymce/' ) . "plugins/compat3x/plugin$dev_suffix.js", array( 'wp-tinymce-root' ), $tinymce_version );

	$scripts->add( 'wp-tinymce-lists', includes_url( "js/tinymce/plugins/lists/plugin$suffix.js" ), array( 'wp-tinymce' ), $tinymce_version );
}