Skip to content

Instantly share code, notes, and snippets.

@geoffgraham
Created June 14, 2016 19:05
Show Gist options
  • Save geoffgraham/e297c0ecd141705d0e2637bfe78202d6 to your computer and use it in GitHub Desktop.
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
// 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;
}
@calebfergie
Copy link

Hi there,

Where exactly should I add this into the single-event.php file? Do I need to change anything else?

@geoffgraham
Copy link
Author

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.

@calebfergie
Copy link

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