Changeset 11841 for trunk/wp-includes/capabilities.php
- Timestamp:
- 08/19/2009 08:35:24 AM (16 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/capabilities.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/capabilities.php
r11019 r11841 828 828 if ( $user_id == $post_author_data->ID ) { 829 829 // If the post is published... 830 if ( 'publish' == $post->post_status ) 830 if ( 'publish' == $post->post_status ) { 831 831 $caps[] = 'edit_published_posts'; 832 else 832 } elseif ( 'trash' == $post->post_status ) { 833 $trash_meta = get_option('wp_trash_meta'); 834 if ( is_array($trash_meta) && isset($trash_meta['posts'][$post->ID]['status']) && $trash_meta['posts'][$post->ID]['status'] == 'publish' ) 835 $caps[] = 'edit_published_posts'; 836 } else { 833 837 // If the post is draft... 834 838 $caps[] = 'edit_posts'; 839 } 835 840 } else { 836 841 // The user is trying to edit someone else's post. … … 852 857 if ( $user_id == $page_author_data->ID ) { 853 858 // If the page is published... 854 if ( 'publish' == $page->post_status ) 859 if ( 'publish' == $page->post_status ) { 855 860 $caps[] = 'edit_published_pages'; 856 else 861 } elseif ( 'trash' == $page->post_status ) { 862 $trash_meta = get_option('wp_trash_meta'); 863 if ( is_array($trash_meta) && isset($trash_meta['posts'][$page->ID]['status']) && $trash_meta['posts'][$page->ID]['status'] == 'publish' ) 864 $caps[] = 'edit_published_pages'; 865 } else { 857 866 // If the page is draft... 858 867 $caps[] = 'edit_pages'; 868 } 859 869 } else { 860 870 // The user is trying to edit someone else's page.
Note: See TracChangeset
for help on using the changeset viewer.