Visual Editor – Colorize Shortcodes

Managed to get a working solution. What you need: TinyMCE Advanced plugin What you should do: Customize the Visual Blocks Plugin that comes with the TinyMCE plugin and add css classes for each element you would to highlight (just loop through all p elements and parse the innerHTML and check if it contains your specific … Read more

wpeditor issue – shows both mode and not able to focus/edit during visual mode

There are a few ways you can go about adding a wpeditor to text areas. If you have the id value of the textbox you can use this JavaScript command to add the tinyMCE buttons to it dynamically. tinyMCE.execCommand(‘mceAddControl’, false, ‘textbox_id’); In your functions.php, add this code: add_action( ‘edit_page_form’, ‘mytextarea_for_page’ ); function mytextarea_for_page() { wp_editor( … Read more

How to save html and text in the database?

Just use the wpdb insert and update API, no escaping or sanitizing needed as per the doc, just the raw data. Data: (array) Data to replace (in column => value pairs). Both $data columns and $data values should be “raw” (neither should be SQL escaped). Something like: $wpdb->insert( $wpdb->prefix . “myTable”, array( “doiBody” => $_POST[‘doi-body’] … Read more

Get Post ID with insert/edit link

Not an exact answer to your question (hooking into the insert/edit link functionality), but possibly an alternate method that can achieve the same goal (inputting a permalink, outputting a Post ID): https://codex.wordpress.org/Function_Reference/url_to_postid

How to pass the wp_editor content using jquery

You have to access the tinymce object like this: tinymce.get(“your_textarea_ID_goes_here”).setContent(“Place your content here”); As a practical example – if you declared your wp_editor like this: wp_editor( “”, “special_content”, array() ); Then the tinymce call would look like this: tinymce.get(“special_content”).setContent(“Place your content here”); Bonus details: if you want to grab the content from the editor use … Read more

TinyMCE Plugin Parameter

The first few you listed are not WordPress specific, and information about them can be found as follows: inlinepopups tabfocus paste media fullscreen As for the WordPress specific plugins, their source code is here (trac). There are no comments, but here’s my take based on a very cursory read through: wordpress: seems to setup the … Read more

WP_Editor – Setting render location on page

As kaiser has stated, you are attempting to return the the markup for an instance of the WP Editor, but you’re using wp_editor() – a function that echos its output. From the source it is absolutely clearly stated that this method renders the editor. You need to call it exactly where you want it.

all tincymce’s switch when updating page after changing from html to text in custom metabox

This is, as you guessed, default behavior. It’s stored in the wp_usermeta table for each user in the wp_user-settings meta_key and does not differentiate between different editor instances. On a side note, the tinymce version of wp_edior() does not cooperate very well with being inside a meta box. Especially if the metabox is moved, or … Read more