Available since: 2.0
searchwp_set_post
View Parameters »During indexing, SearchWP retrieves the post object for everything that gets indexed. If you would like to manipulate the post object before it is indexed (e.g. change post content, the title, post metadata, etc.) you can use this hook by adding something like the following to your theme’s functions.php
:
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 | |
function my_searchwp_set_post( $the_post ) { | |
// manipulate $the_post in any way you'd like | |
return $the_post; | |
} | |
add_filter( 'searchwp_set_post', 'my_searchwp_set_post' ); |
Parameters
Parameter | Type | Description |
---|---|---|
$the_post |
Object |
The post object being indexed |