SearchWP

This Documentation is for SearchWP Version 3

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:

<?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' );
view raw gistfile1.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$the_post Object

The post object being indexed

[wpforms id="3080"]