Make WordPress Core

Changeset 33711


Ignore:
Timestamp:
08/22/2015 07:42:30 PM (9 years ago)
Author:
boonebgorges
Message:

In wp_delete_term(), the $deleted_term object passed to filters should be generated before term relationships are deleted.

This allows the count property to reflect the pre-delete state of affairs,
rather than always being 0.

Props nicholas_io.
Fixes #33485.

Location:
trunk
Files:
1 added
1 edited

Legend:

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

    r33652 r33711  
    25522552    }
    25532553
     2554    // Get the term before deleting it or its term relationships so we can pass to actions below.
     2555    $deleted_term = get_term( $term, $taxonomy );
     2556
    25542557    $objects = $wpdb->get_col( $wpdb->prepare( "SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id = %d", $tt_id ) );
    25552558
     
    25712574    foreach ( $tax_object->object_type as $object_type )
    25722575        clean_object_term_cache( $objects, $object_type );
    2573 
    2574     // Get the object before deletion so we can pass to actions below
    2575     $deleted_term = get_term( $term, $taxonomy );
    25762576
    25772577    /**
Note: See TracChangeset for help on using the changeset viewer.