Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: post_search_columns

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
1426            * The supported columns are `post_title`, `post_excerpt` and `post_content`.
1427            * They are all included by default.
1428            *
1429            * @since 6.2.0
1430            *
1431            * @param string[] $search_columns Array of column names to be searched.
1432            * @param string   $search         Text being searched.
1433            * @param WP_Query $query          The current WP_Query instance.
1434            */
1435           $search_columns = (array) apply_filters( 'post_search_columns', $search_columns, $q['s'], $this );
1436
1437           // Use only supported search columns.
1438           $search_columns = array_intersect( $search_columns, $default_search_columns );
1439           if ( empty( $search_columns ) ) {
1440                $search_columns = $default_search_columns;
1441           }
1442
1443           /**
1444            * Filters the prefix that indicates that a search term should be excluded from results.