WordPress.org

Make WordPress Core

Ticket #25043: taxonomy.diff

File taxonomy.diff, 611 bytes (added by dllh, 22 months ago)

Adds pre_term_exists filter to term_exists()

  • wp-includes/taxonomy.php

     
    14891489function term_exists($term, $taxonomy = '', $parent = 0) { 
    14901490        global $wpdb; 
    14911491 
     1492        if ( $_term = apply_filters( 'pre_term_exists', false, $term, $taxonomy, $parent ) ) 
     1493                return $_term; 
     1494 
    14921495        $select = "SELECT term_id FROM $wpdb->terms as t WHERE "; 
    14931496        $tax_select = "SELECT tt.term_id, tt.term_taxonomy_id FROM $wpdb->terms AS t INNER JOIN $wpdb->term_taxonomy as tt ON tt.term_id = t.term_id WHERE "; 
    14941497