What is the capability that let users to edit their own posts and not others? I am trying to enable the post authors to avail a plugin function only on the posts they own.
The permission to access the option should be only to that particular post authors and even the editors shouldn't have access. Next to the post authors, only the administrator should have the access.
The plugin's code has:
function init()
{
// must be logged in
if( is_user_logged_in() )
{
// actions
add_action('admin_head', array($this,'admin_head'));
add_action('admin_menu', array($this,'admin_menu'));
add_action('wp_enqueue_scripts', array($this,'wp_enqueue_scripts'));
add_action('wp_head', array($this,'wp_head'));
add_action('wp_footer', array($this,'wp_footer'));
add_action('wp_ajax_live_edit_update_width', array($this, 'ajax_update_width'));
}
}
I have edited the plugin file to change the capabilities(line 79).
function init()
{
// must be logged in
if( is_user_logged_in() && current_user_can('author') || current_user_can('administrator'))
{
// actions
add_action('admin_head', array($this,'admin_head'));
add_action('admin_menu', array($this,'admin_menu'));
add_action('wp_enqueue_scripts', array($this,'wp_enqueue_scripts'));
add_action('wp_head', array($this,'wp_head'));
add_action('wp_footer', array($this,'wp_footer'));
add_action('wp_ajax_live_edit_update_width', array($this, 'ajax_update_width'));
}
}
Now, only the post authors and administrators have access to it. But I want to replace current_user_can('author')
to a capability which lets the author's to edit their own post and not others. The capabilities like edit_posts
or edit_published_posts
gives access to all the posts.
Could any one tell me about a capability which enable users to edit their own posts and not others? Also let me know if the way I used is right. if( is_user_logged_in() && current_user_can('author') || current_user_can('administrator'))
Here is the plugin's code: http://pastebin.com/m1E9QthM. Link to the original plugin is- http://wordpress.org/support/plugin/live-edit