Created
June 14, 2016 19:05
-
-
Save geoffgraham/e297c0ecd141705d0e2637bfe78202d6 to your computer and use it in GitHub Desktop.
The Events Calendar 4.2 // Remove "This event has passed" notice on single-event.php in a specific category
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
// Removes the passed event notice for events in a speicifc category | |
add_filter( 'tribe_the_notices', 'customize_notice', 10, 2 ); | |
function customize_notice( $html, $notices ) { | |
// If text is found in notice, then replace it | |
if (tribe_event_in_category('formation-sur-demande') && stristr( $html, 'This event has passed.' ) ) { | |
// Customize the message as needed | |
$html = str_replace( '', $html ); | |
} | |
return $html; | |
} |
Howdy! This can go into your functions.php
file. Definitely test it out first -- this is three years old and I haven't tested it recently.
Awesome - indeed it is old, but still works! I don't (yet) see any adverse impacts either.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
Where exactly should I add this into the
single-event.php
file? Do I need to change anything else?