Last active
May 22, 2020 21:10
-
-
Save cliffordp/82836c507db01515745db6e5172f4f76 to your computer and use it in GitHub Desktop.
The Events Calendar (V2 Views): Remove the "This event has passed." notice from single events.
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 | |
/** | |
* The Events Calendar (V2 Views): Remove the "This event has passed." notice from single events. | |
* | |
* FYI: There are other places this same notice displays, such as embed view. To remove the notice from everywhere, | |
* remove the code snippet's "if..." logic. | |
* | |
* @link https://gist.github.com/cliffordp/82836c507db01515745db6e5172f4f76 This snippet. | |
* @link https://share.getcloudapp.com/YEud5m7d Screenshot of the notice that gets removed. | |
*/ | |
function tec_remove_is_a_past_event_notice_on_event_single() { | |
/** @var \Tribe\Events\Views\V2\Template_Bootstrap $template */ | |
$template = tribe( \Tribe\Events\Views\V2\Template_Bootstrap::class ); | |
if ( $template->is_single_event() ) { | |
Tribe__Notices::remove_notice( 'event-past' ); | |
} | |
} | |
add_action( 'tribe_pre_get_view', 'tec_remove_is_a_past_event_notice_on_event_single' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🥳