From 9360033fbe04cd00088097299d70707c3d14f189 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: https://develop.svn.wordpress.org/trunk@21791 602fd350-edb4-49c9-b593-d223f7449a82 --- 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();