From daa6757a9b90ef27e2bbcd88a098244ecb96b3bb Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Mon, 10 Sep 2012 16:45:49 +0000 Subject: [PATCH] Check for an empty post in wp_popular_terms_checklist(). _wp_ajax_add_hierarchical_term() doesn't set up global post info. Props SergeyBiryukov. see #21309 git-svn-id: http://core.svn.wordpress.org/trunk@21791 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/template.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 0f250c6362..139b219920 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -167,7 +167,8 @@ function wp_terms_checklist($post_id = 0, $args = array()) { */ function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) { $post = get_post(); - if ( $post->ID ) + + if ( $post && $post->ID ) $checked_terms = wp_get_object_terms($post->ID, $taxonomy, array('fields'=>'ids')); else $checked_terms = array();