wppaste
WordPress

apply_filters( 'mce_external_plugins', array $external_plugins, string $editor_id )

Since
2.5.0, 5.3.0
Filters the list of TinyMCE external plugins.

Description

The filter takes an associative array of external plugins for TinyMCE in the form 'plugin_name' => 'url'.

The url should be absolute, and should include the js filename to be loaded. For example: 'myplugin' => 'http://mysite.com/wp-content/plugins/myfolder/mce_plugin.js'.

If the external plugin adds a button, it should be added with one of the 'mce_buttons' filters.

Compatibility

WordPress
since 5.3.0
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Parameters

$external_pluginsarray
An array of external TinyMCE plugins.
$editor_idstring
Unique editor identifier, e.g. 'content'. Accepts 'classic-block' when called from block editor's Classic block.

Where this hook fires · 2

  • wp-includes/class-wp-editor.php:421_WP_Editors::editor_settings()
  • wp-includes/script-loader.php:605wp_tinymce_inline_scripts()

Source code

<?php					 * @since 5.3.0 The `$editor_id` parameter was added.					 *					 * @param array  $external_plugins An array of external TinyMCE plugins.					 * @param string $editor_id        Unique editor identifier, e.g. 'content'. Accepts 'classic-block'					 *                                 when called from block editor's Classic block.					 */					$mce_external_plugins = apply_filters( 'mce_external_plugins', array(), $editor_id ); 					$plugins = array(						'charmap',						'colorpicker',						'hr',						'lists',

Changelog

Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

5.3.0
The $editor_id parameter was added.from the docblock
2.5.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.