WPSEO_Metabox_Editor::add_custom_element()publicYoast 1.0

Adds a custom element to the tinyMCE editor that we need for marking the content.

Метод класса: WPSEO_Metabox_Editor{}

Хуков нет.

Возвращает

Массив. The new tinyMCE config with our added custom elements.

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

$WPSEO_Metabox_Editor = new WPSEO_Metabox_Editor();
$WPSEO_Metabox_Editor->add_custom_element( $tinymce_config );
$tinymce_config(массив) (обязательный)
The tinyMCE config as configured by WordPress.

Код WPSEO_Metabox_Editor::add_custom_element() Yoast 19.11

public function add_custom_element( $tinymce_config ) {
	if ( ! empty( $tinymce_config['custom_elements'] ) ) {
		$custom_elements = $tinymce_config['custom_elements'];

		$custom_elements .= ',~yoastmark';
	}
	else {
		$custom_elements = '~yoastmark';
	}

	$tinymce_config['custom_elements'] = $custom_elements;

	return $tinymce_config;
}