WP HOOKS
filtrod 2.5.0

mce_external_plugins

Args 2Plik wp-includes/class-wp-editor.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the list of TinyMCE external plugins.

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.

Parametry

ParametrTypOpis
$external_pluginsarrayAn array of external TinyMCE plugins.
$editor_idstringUnique editor identifier, e.g. 'content'. Accepts 'classic-block' when called from block editor's Classic block.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'mce_external_plugins', 'twoja_funkcja', 10, 2 );

function twoja_funkcja($param_1, $param_2) {
	// Twój kod
}