简体   繁体   中英

Wordpress custom tinymce buttons not showing in custom editor

I have multiple wordpress plugins which add button the the wordpress tinyMCE editor. The buttons do show up correctly when i add a new post or page.

However, if i want to print my own editor in my plugin with this code:

wp_editor('value','name',array('media_buttons' => false);

The custom buttons wont show up. It does show the editor, but not the custom buttons.

I have found what I did wrong. I used a function to call wp_editor . This one returns the editor with PHP output buffering. The function returns the editor, or null when it does not need to be displayed.

In my code, the function was called twice, once to check, and once to output. This means the wp_editor is called twice with the same name. As soon as this happens, the settings will be overridden the second time.

Short solution: Never call wp_editor twice with the same name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM