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
This commit is contained in:
Ryan Boren 2012-09-10 16:45:49 +00:00
parent ffac99eadc
commit daa6757a9b

View File

@ -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();