Make WordPress Core

Ticket #28488: post.php.diff

File post.php.diff, 606 bytes (added by barrykooij, 10 years ago)
  • src/wp-includes/post.php

     
    21852185        $cache_key = 'posts-' . $type;
    21862186        if ( 'readable' == $perm && is_user_logged_in() ) {
    21872187                $post_type_object = get_post_type_object( $type );
    2188                 if ( ! current_user_can( $post_type_object->cap->read_private_posts ) ) {
     2188                if ( null !== $post_type_object && !current_user_can( $post_type_object->cap->read_private_posts ) ) {
    21892189                        $cache_key .= '_' . $perm . '_' . get_current_user_id();
    21902190                }
    21912191        }