Changeset 11873
- Timestamp:
- 08/24/2009 08:48:31 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/capabilities.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r11841 r11873 774 774 if ( $user_id == $post_author_data->ID ) { 775 775 // If the post is published... 776 if ( 'publish' == $post->post_status ) 776 if ( 'publish' == $post->post_status ) { 777 777 $caps[] = 'delete_published_posts'; 778 else 778 } elseif ( 'trash' == $post->post_status ) { 779 $trash_meta = get_option('wp_trash_meta'); 780 if (is_array($trash_meta) && isset($trash_meta['posts'][$post->ID]['status']) && $trash_meta['posts'][$post->ID]['status'] == 'publish') 781 $caps[] = 'delete_published_posts'; 782 } else { 779 783 // If the post is draft... 780 784 $caps[] = 'delete_posts'; 785 } 781 786 } else { 782 787 // The user is trying to edit someone else's post. … … 798 803 if ( $user_id == $page_author_data->ID ) { 799 804 // If the page is published... 800 if ( $page->post_status == 'publish' ) 805 if ( $page->post_status == 'publish' ) { 801 806 $caps[] = 'delete_published_pages'; 802 else 807 } elseif ( 'trash' == $page->post_status ) { 808 $trash_meta = get_option('wp_trash_meta'); 809 if (is_array($trash_meta) && isset($trash_meta['posts'][$page->ID]['status']) && $trash_meta['posts'][$page->ID]['status'] == 'publish') 810 $caps[] = 'delete_published_pages'; 811 } else { 803 812 // If the page is draft... 804 813 $caps[] = 'delete_pages'; 814 } 805 815 } else { 806 816 // The user is trying to edit someone else's page.
Note: See TracChangeset
for help on using the changeset viewer.