Make WordPress Core

Ticket #36978: 36978.patch

File 36978.patch, 1.1 KB (added by spacedmonkey, 10 years ago)
  • src/wp-includes/taxonomy.php

     
    927927                return false;
    928928        }
    929929
     930        /**
     931         * Get all Term data from database by Term field and data.
     932         *
     933         * This allows one to short-circuit the default logic, perhaps by
     934         * replacing it with a routine that is more optimal for your setup.
     935         *
     936         * @since 4.6.0
     937         *
     938         * @param string     $field    Either 'slug', 'name', 'id' (term_id), or 'term_taxonomy_id'
     939         * @param string|int $value    Search for this term value
     940         * @param string     $taxonomy Taxonomy name. Optional, if `$field` is 'term_taxonomy_id'.
     941         * @param string     $output   Constant OBJECT, ARRAY_A, or ARRAY_N
     942         * @param string     $filter   Optional, default is raw or no WordPress defined filter will applied.
     943         */
     944        $pre = apply_filters( 'pre_get_term_by', null, $field, $value, $taxonomy, $output, $filter );
     945        if ( null !== $pre ) {
     946                return $pre;
     947        }
     948
    930949        $tax_clause = $wpdb->prepare( "AND tt.taxonomy = %s", $taxonomy );
    931950
    932951        if ( 'slug' == $field ) {