mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@29318 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2314,7 +2314,7 @@ function _count_posts_cache_key( $type = 'post', $perm = '' ) {
|
||||
$cache_key = 'posts-' . $type;
|
||||
if ( 'readable' == $perm && is_user_logged_in() ) {
|
||||
$post_type_object = get_post_type_object( $type );
|
||||
if ( ! current_user_can( $post_type_object->cap->read_private_posts ) ) {
|
||||
if ( $post_type_object && ! current_user_can( $post_type_object->cap->read_private_posts ) ) {
|
||||
$cache_key .= '_' . $perm . '_' . get_current_user_id();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user