apply_filters( ‘post_search_columns’, string[] $search_columns, string $search, WP_Query $query )

In this article

Filters the columns to search in a WP_Query search.

Description

The supported columns are post_title, post_excerpt and post_content.
They are all included by default.

Parameters

$search_columnsstring[]
Array of column names to be searched.
$searchstring
Text being searched.
$queryWP_Query
The current WP_Query instance.

Source

$search_columns = (array) apply_filters( 'post_search_columns', $search_columns, $q['s'], $this );

Changelog

VersionDescription
6.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.