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
This commit is contained in:
Ryan Boren 2012-09-10 16:45:49 +00:00
parent 0cef59e4c0
commit 9360033fbe
1 changed files with 2 additions and 1 deletions

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