Created
March 26, 2020 16:39
-
-
Save jchristopher/c6fb19db32e5cd4aa409fcf0f6ad60df 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