Whitespacing/coding standards cleanup for capabilities.php
git-svn-id: http://svn.automattic.com/wordpress/trunk@8573 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
74c46749cb
commit
d40ac02f98
|
@ -40,7 +40,8 @@ class WP_Roles {
|
|||
|
||||
$this->roles[$role] = array(
|
||||
'name' => $display_name,
|
||||
'capabilities' => $capabilities);
|
||||
'capabilities' => $capabilities
|
||||
);
|
||||
if ( $this->use_db )
|
||||
update_option( $this->role_key, $this->roles );
|
||||
$this->role_objects[$role] = new WP_Role( $role, $capabilities );
|
||||
|
@ -307,7 +308,7 @@ function map_meta_cap($cap, $user_id) {
|
|||
// If the user is the author...
|
||||
if ( $user_id == $post_author_data->ID ) {
|
||||
// If the post is published...
|
||||
if ($post->post_status == 'publish')
|
||||
if ( 'publish' == $post->post_status )
|
||||
$caps[] = 'delete_published_posts';
|
||||
else
|
||||
// If the post is draft...
|
||||
|
@ -316,9 +317,9 @@ function map_meta_cap($cap, $user_id) {
|
|||
// The user is trying to edit someone else's post.
|
||||
$caps[] = 'delete_others_posts';
|
||||
// The post is published, extra cap required.
|
||||
if ($post->post_status == 'publish')
|
||||
if ( 'publish' == $post->post_status )
|
||||
$caps[] = 'delete_published_posts';
|
||||
else if ($post->post_status == 'private')
|
||||
elseif ( 'private' == $post->post_status )
|
||||
$caps[] = 'delete_private_posts';
|
||||
}
|
||||
break;
|
||||
|
@ -361,7 +362,7 @@ function map_meta_cap($cap, $user_id) {
|
|||
// If the user is the author...
|
||||
if ( $user_id == $post_author_data->ID ) {
|
||||
// If the post is published...
|
||||
if ($post->post_status == 'publish')
|
||||
if ( 'publish' == $post->post_status )
|
||||
$caps[] = 'edit_published_posts';
|
||||
else
|
||||
// If the post is draft...
|
||||
|
@ -370,9 +371,9 @@ function map_meta_cap($cap, $user_id) {
|
|||
// The user is trying to edit someone else's post.
|
||||
$caps[] = 'edit_others_posts';
|
||||
// The post is published, extra cap required.
|
||||
if ($post->post_status == 'publish')
|
||||
if ( 'publish' == $post->post_status )
|
||||
$caps[] = 'edit_published_posts';
|
||||
else if ($post->post_status == 'private')
|
||||
elseif ( 'private' == $post->post_status )
|
||||
$caps[] = 'edit_private_posts';
|
||||
}
|
||||
break;
|
||||
|
@ -385,7 +386,7 @@ function map_meta_cap($cap, $user_id) {
|
|||
// If the user is the author...
|
||||
if ( $user_id == $page_author_data->ID ) {
|
||||
// If the page is published...
|
||||
if ($page->post_status == 'publish')
|
||||
if ( 'publish' == $page->post_status )
|
||||
$caps[] = 'edit_published_pages';
|
||||
else
|
||||
// If the page is draft...
|
||||
|
@ -394,9 +395,9 @@ function map_meta_cap($cap, $user_id) {
|
|||
// The user is trying to edit someone else's page.
|
||||
$caps[] = 'edit_others_pages';
|
||||
// The page is published, extra cap required.
|
||||
if ($page->post_status == 'publish')
|
||||
if ( 'publish' == $page->post_status )
|
||||
$caps[] = 'edit_published_pages';
|
||||
else if ($page->post_status == 'private')
|
||||
elseif ( 'private' == $page->post_status )
|
||||
$caps[] = 'edit_private_pages';
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue