Can i set css class for table via TinyMCE [closed]

This is possible with a custom plugin, but lot of effort. I like the way about css in the front end. The table button in TinyMCE creates a default table, without classes, like: <table> <tr> <td>Text</td> <td>Text</td> <td>Text</td> </tr> <tr> <td>Text</td> <td>Text</td> <td>Text</td> </tr> <tr> <td>Text</td> <td>Text</td> <td>Text</td> </tr> </table> Below a simple example to … Read more

Visual Editor is blank – 404 for plugin js

Have you updated to the latest version of the WCK – Custom Fields and Custom Post Types Creator plugin? The issue is with the WCK – Custom Fields and Custom Post Types Creator plugin and you should probably seek direct assistance from them. https://wordpress.org/plugins/wck-custom-fields-and-custom-post-types-creator/ When I checked the plugins code (vers. 1.1.5) I can see … Read more

Why exactly does WordPress use p tags, not divs?

You should simply not use <div>-elements to seperate paragraphs from each other. It´s wrong in the semantical context, I think. When you press “Enter” you make, from a historical point of view, a “carriage return” and then a “line feed”. You start a new line, maybe a new paragraph but nothing completely new. If you … Read more

TinyMCE not loading in IE8

The hook admin_init is to early for dequeuing, use wp_print_scripts, see examples in the Codex. define( ‘SCRIPT_DEBUG’, true ); will prevent combining dashboard scripts, so if that works for you on IE8, then do it for users with IE8: /** * True if user browser is IE8. */ $is_IE8 = preg_match( ‘/(?i)msie 8/’, $_SERVER[‘HTTP_USER_AGENT’] ); … Read more

Stop editor from adding “amp;” after every “&”

One solution is to hook into wp_insert_post_data and do some regex magic to replace all instances of &amp; with &: // when saving posts, replace &amp; with & function cc_wpse_264548_unamp( $data ) { $data[‘post_content’] = preg_replace( “/&amp;/”, // find ‘&amp;’ “&”, // replace with ‘&’ $data[‘post_content’] // target the ‘post_content’ ); return $data; } add_filter( … Read more

How to apply a custom skin to WP_Editor / TinyMCE?

Apparently, the default WordPress style files overwrite a custom TinyMCE skin. So what you need to do is deregister WordPress’s TinyMCE skin. Since I needed the custom skin to only apply on the front-end on my website, I wrapped it inside an !is_admin() conditional. function remove_editor_buttons_style() { // If not on wp-admin if ( !is_admin() … Read more

How can a TinyMCE modal return formatted/visual text?

(Revised answer) You can use tinymce.DOM.encode() to convert all HTML tags to their entities, e.g. &lt; for < and &gt; for >: var html = tinymce.DOM.encode(e.data.code); Then to preserve trailing white-spaces: html = html.replace(/(^ +| +$)/gm, function(match, p1){ return p1.replace(/ /g, ‘&nbsp;’); }); And this to convert all line breaks to <br>: html = html.replace(/(?:\r\n|\r|\n)/g, … Read more