Articles of plugin tinymce

TinyMCE custom button retrieve value from custom field

I’m creating a plugin that adds a custom button to the default TinyMCE editor in WordPress admin. The following code builds this simple plugin mkay-tinymce-extra-button.php function mkay_enqueue_plugin_script( $plugin_array ){ $plugin_array[‘subscriptionPlugin’] = plugin_dir_url( __FILE__ ) . ‘mkay-tinymce-extra-buttons.js’; return $plugin_array; } add_filter( ‘mce_external_plugins’, ‘mkay_enqueue_plugin_script’ ); function mkay_register_buttons_editor( $buttons ){ array_push( $buttons, ‘subscription’ ); return $buttons; } add_filter( […]

How to add custom tinymce plugin to new text widget

So I have a custom TinyMCE plugin, which adds a button to the editor. I’m using the mce_external_plugins and mce_buttons filter to add my TinyMCE plugin. After WP 4.8 introduced the simple TinyMCE for the new text widget i would like to include my button i that editor as well. For some reason i can’t […]

Front-end image upload from TinyME

I’m trying to edit the Q&A Plugin (which for those of you that don’t know it is a StackExchange-style plugin with Custom Post Types of Questions and Answers) to incorporate image uploads. It seems to use the built-in TinyMCE editor that came bundled with recent versions of WP. This comes with the “Media Library” buttons. […]

Custom styles in Tiny MCE with an external CSS file

I have just read an article on how to implement custom styles to the WordPress Tiny MCE. To be honest I am a bit confused as to why we have to add arrays of styles to functions.php. The problem I have is that the styles are applied as inline CSS (see the picture). This is […]

Using post ID in custom tinyMCE button

I’m building a simple plugin and need to be able to access current post id when user clicks custom tinyMCE button (inside its onclick function). How should I get current post ID to do that. Just for this example, code from this tutorial: http://brettterpstra.com/2010/04/17/adding-a-tinymce-button/ can be used, and after clicking on the button, current post […]

Hook into existing tinyMCE button

Is there a way to hook into an existing tinyMCE editor button? I have a plugin that currently has a button on the editor and it shows a popup-box when clicked. This box has tabs inside. I would like to be able to create another plugin but check if the button already exists, if it […]

Customer Support: TinyMCE stopped working (on some computers)

I’m sold on this one. A client has reported he can’t edit any text on posts or pages on his WordPress site, claiming the visual editor text is white and he can’t click on any buttons. Not even the HTML tab works. He sent me a screenshot where I can see his text is appearing […]

More than one TinyMCE (wp_editor) with different $settings values breaks

It appears that when I have two+ separate wp_editors with different values for drag_drop_upload they all are built as if they have drag_drop_upload set to true. If I set them all to false they act as expected, but if they have different values they do not. Here is code to demonstrate: add_action( ‘add_meta_boxes’, function() { […]

Trouble adding tiny mce to textarea in custom plugin

I’m using the Sunrise open-source OOP framework to develop my plugin. I am building out a new settings page and I’m having trouble adding in a WYSIWYG/tiny MCE textarea to the settings page. I’ve tried following multiple tutorials on the internet and I’ve tried using wp_editor() but everytime I do, it spits out a warning: […]

Adding a colorbutton in tinymce dialog with current api

I’m trying to add a colorbutton in a tinymce dialog box, which i was able to do with the help of using this stackoverflow question here: https://stackoverflow.com/questions/23511566/adding-a-colorbutton-in-tinymce-dialog-with-api-4-x-doesnt-work The problem is I need it to take the hex value thats selected and inject it into the shortcode. Here is a fiddle i made http://fiddle.tinymce.com/sZeaab it will […]