Make WordPress Core

Changeset 23552


Ignore:
Timestamp:
03/01/2013 04:22:07 PM (11 years ago)
Author:
SergeyBiryukov
Message:

Make wp_remove_object_terms() return false if nothing has been deleted. props kovshenin. fixes #15475.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/taxonomy.php

    r23484 r23552  
    23132313        $in_tt_ids = "'" . implode( "', '", $tt_ids ) . "'";
    23142314        do_action( 'delete_term_relationships', $object_id, $tt_ids );
    2315         $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id ) );
     2315        $deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id ) );
    23162316        do_action( 'deleted_term_relationships', $object_id, $tt_ids );
    23172317        wp_update_term_count( $tt_ids, $taxonomy );
    23182318       
    2319         return true;
     2319        return (bool) $deleted;
    23202320    }
    23212321
Note: See TracChangeset for help on using the changeset viewer.