terms_pre_query WordPress Filter Hook

The terms_pre_query hook is a WordPress hook that is fired before a terms query is run. This hook can be used to modify the query arguments before the query is run, or to modify the results of the query after the query has been run.

apply_filters_ref_array( 'terms_pre_query', array|null $terms, WP_Term_Query $query ) #

Filters the terms array before the query takes place.


Description

Return a non-null value to bypass WordPress’ default term queries.


Top ↑

Parameters

$terms

(array|null)Return an array of term data to short-circuit WP's term query, or null to allow WP queries to run normally.

$query

(WP_Term_Query)The WP_Term_Query instance, passed by reference.


Top ↑

Source

File: wp-includes/class-wp-term-query.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
5.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.