Available since: 3.0.4
searchwp_is_attribute_used
View Parameters »SearchWP’s engine configuration is based primarily on entry attributes. Each attribute has an associated, individual weight which allows SearchWP’s results to be finely tuned when applicable. To keep its index as small as possible SearchWP will index only content that has been added to a post type within an engine configuration.
Note: This applies to all post types across all engines.
If you’d like to override SearchWP’s internal handling of a used attribute, you can do so with this hook:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'searchwp_is_attribute_used', function( $used, $attribute ) { | |
// TODO: Customize $used where applicable. $attribute is the attribute being evaluated. | |
return $used; // true/false | |
}, 20, 2 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$used |
Boolean |
Whether the attribute is used |
$attribute |
String |
Attribute being evaluated |