SearchWP

This Documentation is for SearchWP Version 3

Available since: 2.9.10

searchwp_and_fields_{$post_type}

View Parameters »

This hook runs prior to searchwp_and_fields and accomplishes the same goal, but with additional context. The return value of this hook will be inherited by searchwp_and_fields.

<?php
add_filter( 'searchwp_and_fields_post', function( $and_fields, $engine ) {
// TODO: Customize $and_fields to match what you want for Posts (and not other post types).
// @link https://searchwp.com/docs/hooks/searchwp_and_fields/
return $and_fields;
}, 20, 2 );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$and_fields Array

The default field types considered during AND passes [ 'title', 'content', 'slug', 'excerpt', 'comment', 'tax', 'meta' ]