Я создал плагин в WordPress, чтобы добавить кнопку в TinyMCE. На данный момент у меня есть приведенный ниже код, который строго соответствует приведенному здесь примеру: https://www.gavick.com/blog/wordpress-t ... -section-1 Файл PHP
Я создал плагин в WordPress, чтобы добавить кнопку в TinyMCE. На данный момент у меня есть приведенный ниже код, который строго соответствует приведенному здесь примеру: https://www.gavick.com/blog/wordpress-tinymce-custom-buttons#tc-section-1 [b]Файл PHP[/b]
//Hook the button on init, so after loading wordpress add_action('init', 'add_button1234');
//add filters within th function which loads after loading wordpress function add_button1234() { // add new buttons add_filter('mce_buttons', 'myplugin_register_buttons1234'); // Load the TinyMCE plugin add_filter('mce_external_plugins', 'register_1234'); }
//Add the newly created button to ithe $buttons array function register_1234($buttons) { array_push($buttons, 'separator', 'button1234'); return $buttons; }
//create the button function myplugin_register_tinymce_javascript1234($plugin_array) { $plugin_array['button1234'] = plugins_url('plugin.js', __FILE__); return $plugin_array; } ?> [/code]