-
-
Save searchwpgists/2c6f281ec7882624991097e1b885aa63 to your computer and use it in GitHub Desktop.
Customize the Title of a Post when it is a search result in SearchWP
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 | |
// Customize the Title of a Post when it is a search result in SearchWP. | |
add_filter( 'searchwp\entry\native', function( $native, $query ) { | |
if ( $native instanceof \WP_Post ) { | |
$native->post_title .= ' search result!'; | |
} | |
return $native; | |
}, 20, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment