mce_buttons хук-фильтрWP 2.0.0

Filters the first-row list of TinyMCE buttons (Visual tab).

Использование

add_filter( 'mce_buttons', 'wp_kama_mce_buttons_filter', 10, 2 );

/**
 * Function for `mce_buttons` filter-hook.
 * 
 * @param array  $mce_buttons First-row list of buttons.
 * @param string $editor_id   Unique editor identifier, e.g. 'content'. Accepts 'classic-block' when called from block editor's Classic block.
 *
 * @return array
 */
function wp_kama_mce_buttons_filter( $mce_buttons, $editor_id ){

	// filter...
	return $mce_buttons;
}
$mce_buttons(массив)
First-row list of buttons.
$editor_id(строка)
Unique editor identifier, e.g. 'content'. Accepts 'classic-block' when called from block editor's Classic block.

Список изменений

С версии 2.0.0 Введена.
С версии 3.3.0 The $editor_id parameter was added.

Где вызывается хук

_WP_Editors::editor_settings()
mce_buttons
wp_tinymce_inline_scripts()
mce_buttons
wp-includes/class-wp-editor.php 676
$mce_buttons = apply_filters( 'mce_buttons', $mce_buttons, $editor_id );
wp-includes/script-loader.php 573
$toolbar1 = apply_filters( 'mce_buttons', $toolbar1, 'classic-block' );

Где используется хук в WordPress

Использование не найдено.