Tribe_Events::should_display()
Determines if we should display the shortcode in a given page.
Return
(mixed|void)
Source
File: src/Tribe/Views/V2/Shortcodes/Tribe_Events.php
public function should_display() {
/**
* On blocks editor shortcodes are being rendered in the screen which for some unknown reason makes the admin
* URL soft redirect (browser history only) to the front-end view URL of that shortcode.
*
* @see TEC-3157
*/
$should_display = ! ( is_admin() && ! tribe( 'context' )->doing_ajax() );
/**
* If we should display the shortcode.
*
* @since 5.9.0
*
* @param bool $should_display Whether we should display or not.
* @param static $shortcode Instance of the shortcode we are dealing with.
*/
$should_display = apply_filters( 'tribe_events_shortcode_tribe_events_should_display', $should_display, $this );
return tribe_is_truthy( $should_display );
}
Changelog
| Version | Description |
|---|---|
| 5.9.0 | Introduced. |