WordPress.org

Make WordPress Core

Changeset 38621


Ignore:
Timestamp:
09/18/16 18:52:56 (11 months ago)
Author:
boonebgorges
Message:

Pass taxonomy name to actions in term-relationship CRUD functions.

Props Takahashi_Fumiki.
Fixes #38006.

File:
1 edited

Legend:

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

    r38484 r38621  
    25272527         * 
    25282528         * @since 2.9.0 
     2529         * @since 4.7.0 Added the `$taxonomy` parameter. 
    25292530         * 
    2530          * @param int $object_id Object ID. 
    2531          * @param int $tt_id     Term taxonomy ID. 
     2531         * @param int    $object_id Object ID. 
     2532         * @param int    $tt_id     Term taxonomy ID. 
     2533         * @param string $taxonomy  Taxonomy slug. 
    25322534         */ 
    2533         do_action( 'add_term_relationship', $object_id, $tt_id ); 
     2535        do_action( 'add_term_relationship', $object_id, $tt_id, $taxonomy ); 
    25342536        $wpdb->insert( $wpdb->term_relationships, array( 'object_id' => $object_id, 'term_taxonomy_id' => $tt_id ) ); 
    25352537 
     
    25382540         * 
    25392541         * @since 2.9.0 
     2542         * @since 4.7.0 Added the `$taxonomy` parameter. 
    25402543         * 
    2541          * @param int $object_id Object ID. 
    2542          * @param int $tt_id     Term taxonomy ID. 
     2544         * @param int    $object_id Object ID. 
     2545         * @param int    $tt_id     Term taxonomy ID. 
     2546         * @param string $taxonomy  Taxonomy slug. 
    25432547         */ 
    2544         do_action( 'added_term_relationship', $object_id, $tt_id ); 
     2548        do_action( 'added_term_relationship', $object_id, $tt_id, $taxonomy ); 
    25452549        $new_tt_ids[] = $tt_id; 
    25462550    } 
     
    26622666         * 
    26632667         * @since 2.9.0 
     2668         * @since 4.7.0 Added the `$taxonomy` parameter. 
    26642669         * 
    26652670         * @param int   $object_id Object ID. 
    26662671         * @param array $tt_ids    An array of term taxonomy IDs. 
     2672         * @param string $taxonomy  Taxonomy slug. 
    26672673         */ 
    2668         do_action( 'delete_term_relationships', $object_id, $tt_ids ); 
     2674        do_action( 'delete_term_relationships', $object_id, $tt_ids, $taxonomy ); 
    26692675        $deleted = $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->term_relationships WHERE object_id = %d AND term_taxonomy_id IN ($in_tt_ids)", $object_id ) ); 
    26702676 
     
    26752681         * 
    26762682         * @since 2.9.0 
     2683         * @since 4.7.0 Added the `$taxonomy` parameter. 
    26772684         * 
    2678          * @param int   $object_id Object ID. 
    2679          * @param array $tt_ids    An array of term taxonomy IDs. 
     2685         * @param int    $object_id Object ID. 
     2686         * @param array  $tt_ids    An array of term taxonomy IDs. 
     2687         * @param string $taxonomy  Taxonomy slug. 
    26802688         */ 
    2681         do_action( 'deleted_term_relationships', $object_id, $tt_ids ); 
     2689        do_action( 'deleted_term_relationships', $object_id, $tt_ids, $taxonomy ); 
    26822690 
    26832691        wp_update_term_count( $tt_ids, $taxonomy ); 
Note: See TracChangeset for help on using the changeset viewer.