Tag Info

Hot answers tagged

2

I had a lot of trouble finding information and examples of this, so here you go: https://github.com/dtbaker/wordpress-mce-view-and-shortcode-editor This converts a [shortcode] into a nice custom view to match the frontend, and adds an edit button for easy shortcode editing. <?php /** * Class dtbaker_Shortcode_Banner * handles the creation of ...


2

I am probably late to this party but after using the above solution, I soon realized that page load speed of the editor had severely been crippled! Taking a keen look at the code, I realized that the code keeps executing long after tinyMCE.activeEditor has been initialized. The code uses The setInterval() method which evaluates an expression at specified ...


2

You can create a new plugin with the mce_external_plugins filter.. and link it to a js file. Then, in that file you can do your processing. function tinymce_init() { // Hook to tinymce plugins filter add_filter( 'mce_external_plugins', 'tinymce_plugin' ); } add_filter('init', 'tinymce_init'); function tinymce_plugin($init) { // We create a new ...


1

found it. var str = '[boutique_icon icon="phone"]1300 555 555<br />(07) 555 555[/boutique_icon]'; console.debug( wp.shortcode.next( 'boutique_icon', str ) );


1

I couldn't find the extended_valid_elements option in the settings panel for TinyMCE advanced, but adding the following to my functions.php solved it: function override_mce_options($initArray) { $opts = '*[*]'; $initArray['valid_elements'] = $opts; $initArray['extended_valid_elements'] = $opts; return $initArray;} add_filter('tiny_mce_before_init', ...



Only top voted, non community-wiki answers of a minimum length are eligible