Widgets_Manager::should_swap_legacy()
Determine if we should load the legacy widget based on the global query and $post post_type.
Return
(boolean)
Source
File: src/Tribe/Integrations/Elementor/Widgets_Manager.php
public function should_swap_legacy() {
global $post;
// Prevent display on singular tribe_event post type. Since `is_singular` is not reliable in the admin, we'll check another way as well.
if ( is_singular( TEC::POSTTYPE ) ) {
return true;
}
// Second check for singular tribe_event post type as `is_singular` is not always reliable in the admin.
if ( $post->post_type === TEC::POSTTYPE ) {
return true;
}
$document = Elementor_Plugin::instance()->documents->get_current();
// No document? Bail early.
if ( ! $document ) {
return false;
}
// Prevent on our event starter template.
if ( $document->get_name() === Event_Single_Static::get_type() ) {
return true;
}
// If Elementor Pro is active, prevent on our event dynamic template.
if (
tribe( Elementor_Integration::class )->is_elementor_pro_active() &&
$document->get_name() === Event_Single_Dynamic::get_type()
) {
return true;
}
return false;
}
Changelog
| Version | Description |
|---|---|
| 7.0.1 | Introduced. |