epl_elementor_has_loop_grid: show the EPL Listings widget with Elementor Pro

Description #

Tells EPL whether Elementor's Loop Grid widget (part of Elementor Pro) is available. When it is, EPL doesn't register its own EPL Listings widget, so Pro users build listing grids with Loop Grid instead. Return false to keep the EPL Listings widget alongside Loop Grid, or true to hide it.

It runs once when Elementor registers its widgets (elementor/widgets/register, priority 100, after Elementor Pro has registered Loop Grid).

Part of the Elementor integration, which is in beta. See Elementor widgets and templates (beta) for how the widgets and templates fit together.


Usage #

add_filter( 'epl_elementor_has_loop_grid', 'my_function', 10, 2 );

Parameters #

$available (bool)
True when a widget named loop-grid is registered.

$widgets_manager (\Elementor\Widgets_Manager)
Elementor's widgets manager.


Examples #

Keep the EPL Listings widget available on a site with Elementor Pro:

add_filter( 'epl_elementor_has_loop_grid', '__return_false' );

If you hide the EPL Listings widget, pages that already use it stop showing those listings. The Listings Loop widget's template list checks for Loop Grid on its own and isn't affected by this filter.


Source #

lib/page-builders/elementor/class-epl-elementor.php, in EPL_Elementor::has_elementor_loop_grid(), called from EPL_Elementor::register_widgets(). Since 3.6.