Convert this textarea to rich html format via wp_editor

You basically have two options, using PHP or Javascript. With PHP you would use the wp_editor function to output the textarea for you, and with Javascript you would convert the existing textarea with wp.editor.initialize. Note there are slightly different settings available for each approach. PHP wp_editor function in Codex $id = ‘yith_vendor_biografia’; $content = esc_textarea( … Read more

Insert wp_editor on front-end with AJAX?

So, after doing some more digging, I answered my own question by “connecting the dots”, so to speak. There’s a lot of bits and pieces of info on this topic on StackOverflow and StackExchange, but none of them really answered my question. So here is the full working code to loading a wp_editor instance with … Read more

Disable WP Editor for specific page templates

Yes, try this : function remove_editor() { if (isset($_GET[‘post’])) { $id = $_GET[‘post’]; $template = get_post_meta($id, ‘_wp_page_template’, true); switch ($template) { case ‘template_01.php’: case ‘template_02.php’: case ‘template_03.php’: case ‘template_04.php’: // the below removes ‘editor’ support for ‘pages’ // if you want to remove for posts or custom post types as well // add this line … Read more

Disable HTML (Text) Tab in Post Editor

I was hunting for a way to do this, and no-one seems to mention the wp_editor_settings filter. This worked for me: function my_editor_settings($settings) { $settings[‘quicktags’] = false; return $settings; } add_filter(‘wp_editor_settings’, ‘my_editor_settings’);

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)