SearchWP

This Documentation is for SearchWP Version 3

Available since: 2.8.8

searchwp_pre_set_post

View Parameters »

When indexing, SearchWP creates a reference to each post as it is indexed. Using this hook you can modify any number of entries prior to getting indexed. This hook is run for each entry prior to it being indexed.

<?php
// Modify post(s) before SearchWP indexes them.
add_filter( 'searchwp_pre_set_post', function( $the_post ) {
// TODO: Modify $the_post in any way you see fit.
return $the_post;
} );
view raw functions.php hosted with ❤ by GitHub

Parameters

Parameter Type Description
$the_post Object

Entry being indexed

[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]
[wpforms id="3080"]