Hi,
I have found several threads asking to replace the search term when it says “There were no results found”. This is all well and good but the latest version has the search term written after this. I want the text to be replaced with something. I’ve written the function I’ve got below, I just need to know how to identify the string to replace as it involves a variable.
If you want to see the string I want to change, go to this link – http://ssstsuk.co.uk/courses/?tribe_paged=1&tribe_event_display=list&tribe-bar-search=test
Code I’ve got is below…
add_filter( 'tribe_events_the_notices', 'customize_notice', 10, 2 );
function customize_notice( $html, $notices ) {
// If text is found in notice, then replace it
if( stristr( $html, 'There were no results found.' ) ) {
// Customize the message as needed
$searchchange = str_replace( 'There were no results found.', 'Your custom notice goes here.', $searchchange );
}
return $searchchange;
}
Obviously the variable needs to be added in the first bit. Any help greatly appreciated.