llgruff
@llgruff
Scala

Как добавить в html редактор WordPress кнопку, если она уже есть в tinyMCE?

Мне удобно пользоваться html редактором, визуальный отключен в настройках.
В теме создана кнопка вызова 13 шорткодов, но отображается эта кнопка только в визуальном редакторе tinyMCE.
<?php
// registers the buttons for use
function office_register_buttons( $buttons ) {
	array_push( $buttons, "office_shortcodes" );
	return $buttons;
}

// filters the tinyMCE buttons and adds our custom buttons
function office_shortcode_buttons( ) {
	// Don't bother doing this stuff if the current user lacks permissions
	if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) )
		return;
	// Add only in Rich Editor mode
	if ( get_user_option( 'rich_editing' ) == 'true' ) {
		// filter the tinyMCE buttons and add our own
		add_filter( "mce_external_plugins", "office_add_tinymce_plugin" );
		add_filter( 'mce_buttons', 'office_register_buttons' );
	} //get_user_option( 'rich_editing' ) == 'true'
}
// init process for button control
add_action( 'init', 'office_shortcode_buttons' );

// add the button to the tinyMCE bar
function office_add_tinymce_plugin( $plugin_array ) {
	$plugin_array[ 'office_shortcodes' ] = get_template_directory_uri() . '/mce/office-shortcodes-popup.js';
	return $plugin_array;
}

Хочется просто копировать кнопку вызова шорткодов в html редактор.

Подскажите как это можно сделать.
Благодарю за ответ.
  • Вопрос задан
  • 571 просмотр
Решения вопроса 1
wppanda5
@wppanda5 Куратор тега WordPress
WordPress Mедведь
В данном случае , малой кровью никак.
Шорткоды в office-clean предназначены для работы в tinyMCE
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы