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

How can I get the user that publishes a post?

I am not sure if that is built in, but you can try adding something like this to your functions.php function set_publisher( $new_status, $old_status, $post ) { $publisher_id = get_current_user_id(); if ( $new_status == ‘publish’ && $publisher_id > 0) { update_post_meta($post->ID, ‘post_publisher’, $publisher_id); } } add_action( ‘transition_post_status’, ‘set_publisher’, 10, 3 ); And then when you … Read more

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