TinyMCE Keyup Function

// get tinymce instance of wp default editor var ed = tinyMCE.getInstanceById(‘content’); // add a callback to tinyMCE.onKeyUp event ed.onKeyUp.add(function(){ // format: text will strip html tags console.log( ed.getContent({ format: ‘text’ }) ).length; }) http://www.tinymce.com/wiki.php/api3:event.tinymce.editor.onkeyup

Should the WP post editor B (bold) button be inserting a tag instead of in HTML5?

Here’s what I came up with. So far it doesn’t seem to have broken anything: add_filter(‘tiny_mce_before_init’, ‘modify_formats’); function modify_formats($settings){ $formats = array( ‘bold’ => array(‘inline’ => ‘b’), ‘italic’ => array(‘inline’ => ‘i’) ); $settings[‘formats’] = json_encode( $formats ); return $settings; } One could easily have used plus a class here, but given the changes in … Read more

How do i disable/disallow and tags in TinyMCE?

Simple way, do not add content when logged in as admin user but only as author. If you want to go to somewhat extreme, remove the posting capabilities from the admin. Not sure where that will leave you with editing slugs so a proper check of permission will be needed. This answers your question as … Read more

Customising the WordPress TinyMce editor and it’s buttons

I think theme_advanced_buttons1, theme_advanced_buttons2 etc were part of the TinyMCE advanced theme which is no longer available in TinyMCE 4. WordPress 4.9.7 is using TinyMCE version 4.7.11. The two rows of controls are now referred to with: mce_buttons mce_buttons_2 Here is a good example, taken from https://www.kevinleary.net/customizing-tinymce-wysiwyg-editor-wordpress/ which allows easy customisation of the buttons on … Read more

Add table controls with wp_editor minimal editor configuration (‘teeny’)

Finally got it running with few pieces of extra buttons too :): <?php $tinymce_options = array(‘plugins’ => “table,lists,link,textcolor,hr”, ‘toolbar1’=>”fontsizeselect,forecolor,backcolor,bold,italic,underline,strikethrough,alignleft,aligncenter,alignright,alignjustify”,’toolbar2’=>”blockquote,hr,table,bullist,numlist,undo,redo,link,unlink”); $editor_config= array(‘teeny’=>true, ‘textarea_rows’=>5, ‘editor_class’=>’csec_text’, ‘textarea_name’=>’csec_text’, ‘wpautop’=>false, ‘tinymce’=>$tinymce_options); wp_editor($content, $id, $editor_config); ?> Check: wp_editor in add_meta_boxes does not show gallery for better option working in accordance with WordPress.

WordPress visual editor broke due to non standard port?

I had exactly same issue with Visual Editor but my site was working on port 80. This is what I did : Edited wp-config.php and added the following : define( ‘CONCATENATE_SCRIPTS’, false ); and everything worked fine. Additionally you can check if wp-includes/js/tinymce/wp-tinymce.js.gz file exists or not. If not, then upload it via FTP