Initialize TinyMCE editor / visual editor after AJAX insert

I have a “repeater” style field group on a custom options page. There’s an active visual editor in a hidden state, and when the user clicks “add new” the whole row is cloned. I then need to initialize the visual editor in the cloned row. My code: $(‘.repeater-add-new’).click(function(event) { event.preventDefault(); var target = $(this).data(‘repeater’); $( … Read more

Add self-closing shortcode button to TinyMCE in WP 4.6

I’m familiar with creating self-closing shortcodes like: // shortcode function wpse_shortcode_example( $wpse_atts ) { // Attributes $wpse_atts = shortcode_atts( array( ‘foo’ => ‘bar’, ‘width’ => ‘100%’, ‘height’ => ‘auto’, ), $wpse_atts, ‘wpse’ ); // Return return ‘<embed src=”‘ . $wpse_atts[‘src’] . ‘” width=”‘ . $wpse_atts[‘width’] . ‘” height=”‘ . $wpse_atts[‘height’] . ‘”; } add_shortcode( ‘wpse’, … Read more

How to Add WYSIWYG Editor (tinyMCE) to plugin options page compatible with WordPress 3.0 and up?

I’m trying to add tinyMCE instead of textarea for one of my options in my plugin with no luck so far. I tried this : http://www.dbuggr.com/smallwei/add-wysiwyg-editor-tinymce-wordpress-plugin/ and this: http://blog.imwd8solutions.com/wordpress/wordpress-plugin-development-add-editor-to-plugin-admin-page/ There seems to be some problem with styles as styles for tabs (HTML style/Visual style) dont work. Anybody knows about implementation that works 100% with WP … Read more

Forcing reload of editor-style.css

Is there a method to force the refresh of editor-style.css, when I change manually the stylesheet for the TinyMCE editor? Modification doesn’t show immediately but they will be cached in the admin side of administration backend. For example like this: editor-style.css?ver=3393201 5 There is a hook for that: ‘mce_css’. It is called in _WP_Editors::editor_settings() and … Read more