Use MarkItUp as editor and not the default

Yes, It is possible … there is a good article on DigWP – which points out one warning that MarkDown is not reversible (ie articles written in Markdown get saved in Markdown so if you ever turn off MarkDown, then you’re left with goo on your screen). There is a MarkitUp plugin on the WordPress.org … Read more

Always paste as a text in visual editor

function tinymce_paste_as_text( $init ) { $init[‘paste_as_text’] = true; return $init; } add_filter(‘tiny_mce_before_init’, ‘tinymce_paste_as_text’); For details please follow link : tiny_mce_before_init Thanks!

Float images in content

You need to setup CSS settings for alignleft class of your theme: .alignleft, img.alignleft { /* … */ display: inline; float: left; /* … */ } And you need to add editor stylesheet where the same CSS will be presented. Create editor-style.css file in your theme, put content CSS settings there and call add_editor_style(); from … Read more

How to get Text Selection in WordPress Editor

The visual editor is an TinyMCE implementation. The first way to repace a selected text, is to write a plugin for the TinyMCE. If you do not want to write a plugin, use the tinyMCE object: add_action( ‘admin_footer’, ‘tinyNagging’ ); function tinyNagging() { echo ‘ <script type=”text/javascript”> jQuery(document).ready( function() { window.setInterval( function(){ var selectedText = … Read more

Define multiple Gutenberg editor widths

You may need to use the same approach that conditional editor stylesheets require now (for TinyMCE). function my_theme_add_editor_styles() { global $post; $post_type = get_post_type( $post->ID ); $editor_style=”editor-style-” . $post_type . ‘.css’; add_editor_style( $editor_style ); } add_action( ‘pre_get_posts’, ‘my_theme_add_editor_styles’ ); This snippet is from a Hongkiat article describing the process. Note: You would then have a … Read more