Why Editor reformats my code

I suggest you to use htmlspecialchars() before sending content andhtmlspecialchars_decode() before showing content on page, here is functions that you need to copy/paste to your functions.php : function wp_po9568($content) { return htmlspecialchars($content); } add_filter(‘content_save_pre’,’wp_po9568′); And: function wp_po5689($content) { return htmlspecialchars_decode($content); } add_filter( ‘the_content’,’wp_po5689′); WordPress by default comments out php tags.

Adding tables to the WordPress Editor

updated with more explanation If you want to build this into your theme – this tutorial for adding some code to functions.php will work. Keep in mind you will have to download TinyMCE and add files to /wp-includes for this to work. That’s because “table management” is a plugin for TinyMCE and doesn’t ship with … Read more

Send data to Editor before saving the post

Assuming you refer to the WP main editor, you can get the TinyMCE instance with var mainEditor = tinyMCE.getInstanceById(‘content’); then clear the current content with: mainEditor.setContent(”); and add your new content mainEditor.setContent(‘we are the borg lower your shields and surrender your ships’); If the new content doesn’t get saved, call tinyMCE.triggerSave(); additionally.

How to make the WordPress Editor not accept HTML?

Remove post type support for the editor: add_action( ‘init’, function() { remove_post_type_support( ‘post’, ‘editor’); } ); Now add a new meta box containing only a textarea // print a new meta box function generic_cb($post) { $content = (!empty($post->post_content)) ? $post->post_content : ”; echo ‘<textarea name=”content”>’.$content.'</textarea>’; } function add_before_editor($post) { global $post; add_meta_box( ‘generic_box’, // id, … Read more

Plugin permissions for Editor role

manage_options is an admin role so I’d still try and changing it even if you’ve changed the roles elsewhere. See http://codex.wordpress.org/Roles_and_Capabilities#Editor for more info. Try the following: add_options_page(‘Orbisius Simple Notice’, ‘Orbisius Simple Notice’, ‘edit_others_posts’, __FILE__, ‘orbisius_simple_notice_options_page’);

Built-in spell checker not working in WordPress 3.3.1

Built in spell checker was always a bad idea especially since it relies on external services that might not support the actual language you are writing in. In addition those services might have changed their API since the days of 3.3.1 in a way that is no longer compatible with the 3.3.1 code. Or am … Read more