Forcing reload of editor-style.css

There is a hook for that: ‘mce_css’. It is called in _WP_Editors::editor_settings() and you get all loaded stylesheets comma separated as the first and only parameter. Now it is easy: Use the global variable $editor_styles (here are your theme’s and parent theme’s editor stylesheets stored already), add the time of the file’s last modification as … 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

How to load wp_editor via AJAX

The main problem are the missing scripts. The scripts enqueued in _WP_Editors::enqueue_scripts() are never printed. The same is true for _WP_Editors::editor_js(). So you have to do that in your AJAX callback handler. I have written a demo plugin and put it on GitHub: T5 AJAX Editor. There is one class named Ajax_Editor. Its method render() … 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)