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:
markjaquith 2008-08-06 20:50:30 +00:00
parent 74c46749cb
commit d40ac02f98
1 changed files with 151 additions and 150 deletions

View File

@ -40,7 +40,8 @@ class WP_Roles {
$this->roles[$role] = array( $this->roles[$role] = array(
'name' => $display_name, 'name' => $display_name,
'capabilities' => $capabilities); 'capabilities' => $capabilities
);
if ( $this->use_db ) if ( $this->use_db )
update_option( $this->role_key, $this->roles ); update_option( $this->role_key, $this->roles );
$this->role_objects[$role] = new WP_Role( $role, $capabilities ); $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 the user is the author...
if ( $user_id == $post_author_data->ID ) { if ( $user_id == $post_author_data->ID ) {
// If the post is published... // If the post is published...
if ($post->post_status == 'publish') if ( 'publish' == $post->post_status )
$caps[] = 'delete_published_posts'; $caps[] = 'delete_published_posts';
else else
// If the post is draft... // 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. // The user is trying to edit someone else's post.
$caps[] = 'delete_others_posts'; $caps[] = 'delete_others_posts';
// The post is published, extra cap required. // The post is published, extra cap required.
if ($post->post_status == 'publish') if ( 'publish' == $post->post_status )
$caps[] = 'delete_published_posts'; $caps[] = 'delete_published_posts';
else if ($post->post_status == 'private') elseif ( 'private' == $post->post_status )
$caps[] = 'delete_private_posts'; $caps[] = 'delete_private_posts';
} }
break; break;
@ -361,7 +362,7 @@ function map_meta_cap($cap, $user_id) {
// If the user is the author... // If the user is the author...
if ( $user_id == $post_author_data->ID ) { if ( $user_id == $post_author_data->ID ) {
// If the post is published... // If the post is published...
if ($post->post_status == 'publish') if ( 'publish' == $post->post_status )
$caps[] = 'edit_published_posts'; $caps[] = 'edit_published_posts';
else else
// If the post is draft... // 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. // The user is trying to edit someone else's post.
$caps[] = 'edit_others_posts'; $caps[] = 'edit_others_posts';
// The post is published, extra cap required. // The post is published, extra cap required.
if ($post->post_status == 'publish') if ( 'publish' == $post->post_status )
$caps[] = 'edit_published_posts'; $caps[] = 'edit_published_posts';
else if ($post->post_status == 'private') elseif ( 'private' == $post->post_status )
$caps[] = 'edit_private_posts'; $caps[] = 'edit_private_posts';
} }
break; break;
@ -385,7 +386,7 @@ function map_meta_cap($cap, $user_id) {
// If the user is the author... // If the user is the author...
if ( $user_id == $page_author_data->ID ) { if ( $user_id == $page_author_data->ID ) {
// If the page is published... // If the page is published...
if ($page->post_status == 'publish') if ( 'publish' == $page->post_status )
$caps[] = 'edit_published_pages'; $caps[] = 'edit_published_pages';
else else
// If the page is draft... // 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. // The user is trying to edit someone else's page.
$caps[] = 'edit_others_pages'; $caps[] = 'edit_others_pages';
// The page is published, extra cap required. // The page is published, extra cap required.
if ($page->post_status == 'publish') if ( 'publish' == $page->post_status )
$caps[] = 'edit_published_pages'; $caps[] = 'edit_published_pages';
else if ($page->post_status == 'private') elseif ( 'private' == $page->post_status )
$caps[] = 'edit_private_pages'; $caps[] = 'edit_private_pages';
} }
break; break;