WordPress.org

Make WordPress Core

Ticket #9345: wp_update_term check for WP Error.diff

File wp_update_term check for WP Error.diff, 660 bytes (added by simonwheatley, 5 years ago)

Code within wp_update_term to check whether the return from get_term is a WP_Error, and return it immediately if it is.

  • Users/simon/Projects/WordPress-Bleeding/site/wordpress/wp-includes/taxonomy.php

     
    15611561 
    15621562        // First, get all of the original args 
    15631563        $term = get_term ($term_id, $taxonomy, ARRAY_A); 
     1564        // Check it's not an error, and return the error immediately if it is 
     1565        if ( is_wp_error( $term ) ) return $term; 
    15641566 
    15651567        // Escape data pulled from DB. 
    15661568        $term = add_magic_quotes($term);