Return an empty stdClass from wp_count_posts() when a nonexistent post type is requested.
props johnpbloch. fixes #24803. git-svn-id: https://develop.svn.wordpress.org/trunk@24826 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ec1ae2334a
commit
e09aaf8cf5
@ -2042,6 +2042,9 @@ function unstick_post($post_id) {
|
||||
function wp_count_posts( $type = 'post', $perm = '' ) {
|
||||
global $wpdb;
|
||||
|
||||
if ( ! post_type_exists( $type ) )
|
||||
return new stdClass;
|
||||
|
||||
$user = wp_get_current_user();
|
||||
|
||||
$cache_key = $type;
|
||||
|
Loading…
Reference in New Issue
Block a user