epl_elementor_single_template_enabled: skip the Elementor single listing template
Description #
When an EPL Single Listing template applies to a listing, EPL shows it in place of the listing body it normally prints. Return false to use EPL's normal single listing template for this page instead.
It runs on the front end only (not in the Elementor editor), on the wp action (priority 20), after EPL has found a template for the listing type (see epl_elementor_single_template_id). It doesn't run when no template applies, or when an Elementor Pro Theme Builder Single template applies to the page, because Pro's template wins.
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_single_template_enabled', 'my_function', 10, 3 );
Parameters #
$enabled (bool)
True to use the template. Default true.
$template_id (int)
The EPL Single Listing template's ID.
$post_type (string)
The listing type, for example property or rental.
Examples #
Use EPL's normal template for one listing:
function my_epl_skip_single_template( $enabled, $template_id, $post_type ) {
if ( 123 === get_queried_object_id() ) {
return false;
}
return $enabled;
}
add_filter( 'epl_elementor_single_template_enabled', 'my_epl_skip_single_template', 10, 3 );
Source #
lib/page-builders/elementor/class-epl-elementor-template-router.php, in EPL_Elementor_Template_Router::maybe_route_single(). Since 3.6.