SearchWP

This Documentation is for SearchWP Version 3

Available since: 1.4.6

searchwp_and_fields

View Parameters »

By default, SearchWP checks all field types when performing AND logic, but you can customize which field types are considered if you’d like.

Example: To have SearchWP only consider post titles and main content when performing AND logic, add the following to your active theme’s functions.php:

<?php
function my_searchwp_and_fields() {
return array( 'title', 'content' );
}
add_filter( 'searchwp_and_fields', 'my_searchwp_and_fields' );
view raw gistfile1.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$and_field_defaults Array

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