Ticket #38006: 38006.2.diff
File 38006.2.diff, 2.2 KB (added by , 8 years ago) |
---|
-
src/wp-includes/taxonomy.php
2527 2527 * 2528 2528 * @since 2.9.0 2529 2529 * 2530 * @param int $object_id Object ID. 2531 * @param int $tt_id Term taxonomy ID. 2530 * @param int $object_id Object ID. 2531 * @param int $tt_id Term taxonomy ID. 2532 * @param string $taxonomy Taxonomy slug. 2532 2533 */ 2533 do_action( 'add_term_relationship', $object_id, $tt_id );2534 do_action( 'add_term_relationship', $object_id, $tt_id, $taxonomy ); 2534 2535 $wpdb->insert( $wpdb->term_relationships, array( 'object_id' => $object_id, 'term_taxonomy_id' => $tt_id ) ); 2535 2536 2536 2537 /** … … 2538 2539 * 2539 2540 * @since 2.9.0 2540 2541 * 2541 * @param int $object_id Object ID. 2542 * @param int $tt_id Term taxonomy ID. 2542 * @param int $object_id Object ID. 2543 * @param int $tt_id Term taxonomy ID. 2544 * @param string $taxonomy Taxonomy slug. 2543 2545 */ 2544 do_action( 'added_term_relationship', $object_id, $tt_id );2546 do_action( 'added_term_relationship', $object_id, $tt_id, $taxonomy ); 2545 2547 $new_tt_ids[] = $tt_id; 2546 2548 } 2547 2549 … … 2664 2666 * 2665 2667 * @param int $object_id Object ID. 2666 2668 * @param array $tt_ids An array of term taxonomy IDs. 2669 * @param string $taxonomy Taxonomy slug. 2667 2670 */ 2668 do_action( 'delete_term_relationships', $object_id, $tt_ids );2671 do_action( 'delete_term_relationships', $object_id, $tt_ids, $taxonomy ); 2669 2672 $deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id ) ); 2670 2673 2671 2674 wp_cache_delete( $object_id, $taxonomy . '_relationships' ); … … 2675 2678 * 2676 2679 * @since 2.9.0 2677 2680 * 2678 * @param int $object_id Object ID. 2679 * @param array $tt_ids An array of term taxonomy IDs. 2681 * @param int $object_id Object ID. 2682 * @param array $tt_ids An array of term taxonomy IDs. 2683 * @param string $taxonomy Taxonomy slug. 2680 2684 */ 2681 do_action( 'deleted_term_relationships', $object_id, $tt_ids );2685 do_action( 'deleted_term_relationships', $object_id, $tt_ids, $taxonomy ); 2682 2686 2683 2687 wp_update_term_count( $tt_ids, $taxonomy ); 2684 2688