Using TinyMce with textareas in meta boxes on custom post types

Here’s a pastebin with your code included. Get the old value of the tinyMCE $meta_biography = get_post_meta( $post->ID, ‘meta_biography’, true ); Call the TinyMCE Editor wp_editor( $meta_biography, ‘biography’, array( ‘wpautop’ => true, ‘media_buttons’ => false, ‘textarea_name’ => ‘meta_biography’, ‘textarea_rows’ => 10, ‘teeny’ => true ) ); Save The Editor Value or if nothing is there … Read more

Load wp_editor via ajax [duplicate]

Add this to your plugin file: (you can also add it on the theme’s functions file) function ajax_wp_editor() { ?> your html form here <?php } //for all users add_action(‘wp_ajax_nopriv_ajax_wp_editor’, ‘ajax_wp_editor’); // for logged in users add_action(‘wp_ajax_ajax_wp_editor’, ‘ajax_wp_editor’); Request Ajax using this URL: [BLOG_ADDRESS]/wp-admin/admin-ajax.php?action=ajax_wp_editor

WP 3.9 TinyMCE no longer loads on category description editor

I was having the same issue and the problem was actually coming from the way the js was dynamically generating tinyMCE. Prior to v.4, it was: tinymce.EditorManager.execCommand(‘mceAddControl’, true, id); With 4, you need to use: tinymce.EditorManager.execCommand(‘mceAddEditor’, true, id); Have a look at wherever your function ‘wp_tiny_mce’ is – might be in there.

Add button to TinyMCE bar without creating a plugin

It is almost code golf, but this is the smallest piece of code that I could up with that will create a button on the Visual editor to turn the current paragraph in a <h2> block. add_filter( ‘tiny_mce_before_init’, ‘wpse18719_tiny_mce_before_init’ ); function wpse18719_tiny_mce_before_init( $initArray ) { $initArray[‘setup’] = <<<JS [function(ed) { ed.addButton(‘h2’, { title : ‘H2’, … Read more

How to get the input of a TinyMCE editor when using on the front-end?

Ok apparently WordPress keeps track of what kind of editor (visual or html) is active as a class which is added to the content wrapper so here is a solution that will get you the latest content in the editor function get_tinymce_content(){ if (jQuery(“#wp-content-wrap”).hasClass(“tmce-active”)){ return tinyMCE.activeEditor.getContent(); }else{ return jQuery(‘#html_text_area_id’).val(); } }

How set defaults on wpLink()

Also an small example for change the url in link-button to use the url from installed blog. Use print JS in footer, not an include from js file via wp_enqueue_script() – ist faster vor development, specially for this small requirement, but not so on standard and fine, how the example from the other answer. <?php … Read more

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