Available since: 3.0
searchwp_is_used_meta_key
View Parameters »Note: Use of this hook will require a manual reindex
When indexing Custom Fields, SearchWP will check to make sure that a Custom Field is in use by engine configuration before indexing it. This is done to keep the index as small as possible. You can use this hook to control whether SearchWP thinks a particular meta key is in use:
Note: This applies to all post types across all engines.
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_used_meta_key', function( $used, $meta_key ) { | |
// TODO: Determine whether the meta key is in use. | |
return $used; // true/false | |
}, 20, 2 ); |
Parameters
Parameter | Type | Description |
---|---|---|
$used |
Boolean |
Whether the meta key is used |
$meta_key |
String |
The meta key |