I’ve been stuggeling with a similar issue. (button not appearing in mce editor toolbar). This pattern worked for me in WP 3.9 / tinymce 4.0:
tinymce.PluginManager.add( 'thing' , function( editor ){
editor.addButton('thing', {
type: 'listbox',
text: 'My listbox',
onselect: function(e) {
// do things...
},
values: [
{text: 'Menu item 1', value: 'Some text 1'},
{text: 'Menu item 2', value: 'Some text 2'}
]
});
});
Sad enough this is not backwards compatibele, so you will either break 3.8 support or you will need to implement some version sniffing.
Related Posts:
- Custom TinyMCE style formats disabled
- Add buttons to the new TinyMCE WP Editor. Javascript API
- Why did multiple line breaks stop working in text editor?
- When switching from html to visual editor the tag gets corrupted
- Markup of oEmbed codes in the editor?
- How can I stop TinyMCE from converting my HTML entities to characters?
- Add Shortcode inline inside Gutenberg block
- TinyMCE editor – new lines not rendered on front end
- WordPress tinymce prints empty P tag and break html format
- WP 3.3 my rich text category editor toolbar is gone!
- Add table controls with wp_editor minimal editor configuration (‘teeny’)
- TinyMCE Plugin Parameter
- Add table button in editor without Plugin
- Is it possible to disable the image alignment options in the post editor?
- How to dynamically generate wordpress editor on frontend?
- Change syntax styling of TinyMCE HTML Text Editor
- More than one TinyMCE (wp_editor) with different $settings[‘drag_drop_upload’] values breaks
- Why is the media upload button not in the main toolbar & can it be placed there instead?
- Adding CSS to admin TinyMCE editor for custom button
- How can a TinyMCE modal return formatted/visual text?
- Allowing style tag in TinyMCE editor
- TinyMCE Advances is removing blanks (” “)
- Why Editor reformats my code
- enable TinyMCE for comment forms
- Best Browser for Editing Posts
- TinyMCE strips off the href tag inside span, if i change from text to visual
- Adding a Media Button to the WordPress Content Editor
- Wordpres Tinymce custom button (Gavick guide)
- Error in backend: Failed to load plugin: tabfocus from url
- Preserve indentation, HTML5 shorthand in editor
- `tinyMCE is not defined` after migrating site to server
- Custom shortcode editor [BackboneJS & TinyMCE)
- How do I separate my theme’s styles from editor styles?
- Problem with Line spacing in wysiwyg editor in WP 3.5.1
- Switch between Visual and HTML tab freely
- Removing buttons from the editor
- How to force TinyMCE in WordPress to replace newlines with tags and not with
- How to use tinyMCE for user “biographical info”?
- How i can i add a split button or list box to the WordPress TinyMCE instance
- Secure Validation of wp_editor in Theme Options
- Detecting when TinyMCE is “ready”
- Second toolbar in tinymce has “display:none” set?
- How can I insert HTML attributes with an existing TinyMCE button?
- Using post ID in custom tinyMCE button
- How to make WordPress and TinyMCE accept tags wrapping block-level elements as allowed in HTML5?
- TinyMCE Autoresize
- onClick inside post_content does not appear in post tinymce editor
- How to get WP editors tinyMCE instances
- Visual Editor freezing on text highlight since 4.3
- Remove ‘Visual’ tab from TinyMCE editor
- What is this: data-wplink-url-error=”true” and why is it added to my links?
- Customising the WordPress TinyMce editor and it’s buttons
- How do i disable/disallow and tags in TinyMCE?
- Text cut off after the character 𪇆 in TinyMCE
- How can I control the HTML output of my post?
- WYSIWYG editor in WP 3.2 plugin
- Add WYSIWYG to Image Description field
- wpeditor issue – shows both mode and not able to focus/edit during visual mode
- Set tinymce direction to rtl
- Add a select a class dropdown in tinymce
- WordPress & TinyMCE: Failed to load
- wp.editor.initialize does not show the same default toolbar
- How to add button in TinyMCE TEENY mode?
- TinyMCE Editor change underline button behavior – u tag instead of span text-decoration underline
- Insert dynamic listbox options in Tinymce popup editor
- Can’t remove generated by editor from database
- Add css class to dropdown
- TinyMCE function: Remove (earlier) added style from the editor
- TinyMCE custom plugin, how to make a word automatically selected based on current cursor position?
- Avoid glitchy characters – my own version of the problem
- Post content not showing in the edit post textarea
- How to add custom font to TinyMCE FontSelect in WP Admin or filter the fonts available
- Disable TinyMCE Table formatting width/height
- Use schema.org HTML in TinyMCE Editor
- Customer Support: TinyMCE stopped working (on some computers)
- How can I make the page editor trust me?
- Adding custom block formats to TinyMCE. Everything works until JavaScript error when applying the format
- How to apply a custom skin to WP_Editor / TinyMCE?
- WordPress wraps span tags into p tags
- Blank spaces show as a question mark
- Can i set css class for table via TinyMCE [closed]
- Where’s the explanation of the TinyMCE’s vars in the WP core?
- How to edit blockquote image
- Customizing tinyMCE 4 Styles and Format dropdowns
- WordPress (TinyMCE) not removing script tags
- Insert attachments from custom uploader into post (regular uploader style)
- How can I remove using built in wordpress filters
- TinyMCE is inactive after installation
- How to set custom TinyMCE format style as default?
- Did Gutenberg block editor change the html in post content during import?
- Load WordPress Editor .css on Front End
- “Formats” Select Menu in WP Editor doesn’t show up with correct colour
- Understanding automatic text formatting in the WordPress editor
- Prevent Black Studio TinyMCE from adding tags when switching from Visual to HTML mode
- how to see P and BR tags in tinymce?
- TinyMce Chrome newline issue
- Inline Editing with wp_editor and tinymce (problem with textarea)
- What is zinging my HTML commands? I don’t think I can blame TinyMCE this time…
- Is there an alternative way to upload html without using TinyMCE?
- Add new MCE button for toggle specific cell background color