WordPress.org

Make WordPress Core

Ticket #21309: 21309.11.diff

File 21309.11.diff, 674 bytes (added by SergeyBiryukov, 20 months ago)
  • wp-admin/includes/template.php

     
    166166 * @return array List of popular term IDs. 
    167167 */ 
    168168function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) { 
    169         $post = get_post(); 
    170         if ( $post->ID ) 
    171                 $checked_terms = wp_get_object_terms($post->ID, $taxonomy, array('fields'=>'ids')); 
     169        global $post_ID; 
     170 
     171        if ( $post_ID ) 
     172                $checked_terms = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) ); 
    172173        else 
    173174                $checked_terms = array(); 
    174175