WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 724 | * |
| 725 | * Return a non-null value to bypass WordPress' default term queries. |
| 726 | * |
| 727 | * @since 5.3.0 |
| 728 | * |
| 729 | * @param array|null $terms Return an array of term data to short-circuit WP's term query, |
| 730 | * or null to allow WP queries to run normally. |
| 731 | * @param WP_Term_Query $query The WP_Term_Query instance, passed by reference. |
| 732 | */ |
| 733 | $this->terms = apply_filters_ref_array( 'terms_pre_query', array( $this->terms, &$this ) ); |
| 734 | |
| 735 | if ( null !== $this->terms ) { |
| 736 | return $this->terms; |
| 737 | } |
| 738 | |
| 739 | // $args can be anything. Only use the args defined in defaults to compute the key. |
| 740 | $key = md5( serialize( wp_array_slice_assoc( $args, array_keys( $this->query_var_defaults ) ) ) . serialize( $taxonomies ) . $this->request ); |
| 741 | $last_changed = wp_cache_get_last_changed( 'terms' ); |
| 742 | $cache_key = "get_terms:$key:$last_changed"; |