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(); } }

TinyMCE editor is breaking my beautiful HTML

Regardless of what you have configured as valid children, WordPress handles p tags as well as line breaks in a very unique way. You’ll probably notice eventually, if you haven’t already, that when switching from the text editor to the visual editor and back that your <p> tags get stripped, similar to what occurs on … Read more

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

WordPress automatically adding ” “?

All I use is remove_filter( ‘the_content’, ‘wpautop’ ); remove_filter( ‘the_excerpt’, ‘wpautop’ ); and that stops WordPress from creating any extra markup. Are you copying and pasting your code from an external editor?

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 [*]

How to add custom CSS (theme option) to TinyMCE?

Solution 1 This works as javascript solution: Example: tinyMCE.activeEditor.dom.addStyle(‘p {color:red; font-size:28px;}’); just open your js console and paste it for a quick test. To target a specific editor one should use: tinyMCE.getInstanceById(‘##editorID##’).dom.addStyle(‘p {color:red; font-size:28px;}’); This will inject the provided string into the editors iframe <head><style id=”mceDefaultStyles”></style> … Solution 2 Use wp_ajax as callback handler to … Read more

Creating a wp_editor instance with custom tinyMCE buttons

You pretty much had it, according to the description. Here’s what you might be looking for for instances 2 and 3 (for instance 1 you can leave the settings empty to get the default set of buttons): Instance 2: wp_editor( $distribution, ‘distribution’, array( ‘media_buttons’ => false, ‘textarea_rows’ => 8, ‘tabindex’ => 4, ‘tinymce’ => array( … Read more

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