mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Return an empty stdClass from wp_count_posts() when a nonexistent post type is requested.
props johnpbloch. fixes #24803. git-svn-id: http://core.svn.wordpress.org/trunk@24826 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
f19377fb81
commit
87f9d112c0
@ -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