Make WordPress Core


Ignore:
Timestamp:
08/25/2009 10:05:15 PM (15 years ago)
Author:
westi
Message:

Move the storage of the metadata for trashed posts into the post meta table rather than storing it in an option. See #4529.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r11873 r11878  
    777777                $caps[] = 'delete_published_posts';
    778778            } 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')
     779                if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) )
    781780                    $caps[] = 'delete_published_posts';
    782781            } else {
     
    806805                $caps[] = 'delete_published_pages';
    807806            } 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')
     807                if ('publish' == get_post_meta($page->ID, '_wp_trash_meta_status', true) )
    810808                    $caps[] = 'delete_published_pages';
    811809            } else {
     
    841839                $caps[] = 'edit_published_posts';
    842840            } elseif ( 'trash' == $post->post_status ) {
    843                 $trash_meta = get_option('wp_trash_meta');
    844                 if ( is_array($trash_meta) && isset($trash_meta['posts'][$post->ID]['status']) && $trash_meta['posts'][$post->ID]['status'] == 'publish' )
     841                if ('publish' == get_post_meta($post->ID, '_wp_trash_meta_status', true) )
    845842                    $caps[] = 'edit_published_posts';
    846843            } else {
     
    870867                $caps[] = 'edit_published_pages';
    871868            } elseif ( 'trash' == $page->post_status ) {
    872                 $trash_meta = get_option('wp_trash_meta');
    873                 if ( is_array($trash_meta) && isset($trash_meta['posts'][$page->ID]['status']) && $trash_meta['posts'][$page->ID]['status'] == 'publish' )
     869                if ('publish' == get_post_meta($page->ID, '_wp_trash_meta_status', true) )
    874870                    $caps[] = 'edit_published_pages';
    875871            } else {
Note: See TracChangeset for help on using the changeset viewer.