WordPress.org

Make WordPress Core

Ticket #11112: get_term.diff

File get_term.diff, 441 bytes (added by scribu, 4 years ago)

Type check before doing anything else

  • wp-includes/taxonomy.php

     
    325325                } 
    326326        } 
    327327 
     328        if ( ! is_object($_term) ) 
     329                return null; 
     330 
    328331        $_term = apply_filters('get_term', $_term, $taxonomy); 
    329332        $_term = apply_filters("get_$taxonomy", $_term, $taxonomy); 
    330333        $_term = sanitize_term($_term, $taxonomy, $filter);