Make WordPress Core


Ignore:
Timestamp:
07/29/2014 12:50:53 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Avoid PHP notices in _count_posts_cache_key(), _update_blog_date_on_post_publish(), and _update_blog_date_on_post_delete() if post type is not registered.

props jesin.
fixes #28135.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r29113 r29318  
    23152315    if ( 'readable' == $perm && is_user_logged_in() ) {
    23162316        $post_type_object = get_post_type_object( $type );
    2317         if ( ! current_user_can( $post_type_object->cap->read_private_posts ) ) {
     2317        if ( $post_type_object && ! current_user_can( $post_type_object->cap->read_private_posts ) ) {
    23182318            $cache_key .= '_' . $perm . '_' . get_current_user_id();
    23192319        }
Note: See TracChangeset for help on using the changeset viewer.