How to use tinyMCE for user “biographical info”?

I found a very helpful blog post which shows exactly how to accomplish what I am after with only three small changes to the user-edit.php page. First Change I had to add a class name to the <textarea> tag for the description. <textarea name=”description” id=”description” rows=”5″ cols=”30″ class=”CLASS_NAME_HERE”><?php echo esc_html($profileuser->description); ?> </textarea><br /> Second Change … Read more

Enqueue Script After TinyMCE initialized

Adding scripts after TinyMCE: You might check out the before_wp_tiny_mce and after_wp_tiny_mcehooks. If you take a look at the file /wp-includes/class-wp-editor.php you can see that the TinyMCE settings scripts are not all loaded through the usual enqueue methods, but some are displayed via: add_action( ‘admin_print_footer_scripts’, array( __CLASS__, ‘editor_js’), 50 ); where the editor_js method contains … 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

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 to customize TinyMCE4 in WP 3.9 – the old way for styles and formats doesn’t work anymore

If you look in class-wp-editor.php you’ll find that the filter you are using is still there, however the settings are different. self::$first_init = array( ‘theme’ => ‘modern’, ‘skin’ => ‘lightgray’, ‘language’ => self::$mce_locale, ‘formats’ => “{ alignleft: [ {selector: ‘p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li’, styles: {textAlign:’left’}}, {selector: ‘img,table,dl.wp-caption’, classes: ‘alignleft’} ], aligncenter: [ {selector: ‘p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li’, styles: {textAlign:’center’}}, {selector: ‘img,table,dl.wp-caption’, … Read more

How to disable TinyMCE from removing span tags

[*] I couldn’t find the extended_valid_elements option in the settings panel for TinyMCE advanced, but adding the following to my functions.php solved it: function override_mce_options($initArray) { $opts=”*[*]”; $initArray[‘valid_elements’] = $opts; $initArray[‘extended_valid_elements’] = $opts; return $initArray; } add_filter(‘tiny_mce_before_init’, ‘override_mce_options’); Source [*]