FacetWP – dynamically register a FacetWP template

mgibbs189

{{gist file=”test.js” lang=”javascript”}}
<?php

public function register_listings_template( $templates ) {
$templates[] = array(
‘label’ => ‘Listings’,
‘name’ => ‘listings’,
‘query’ => ”,
‘template’ => ”,
‘modes’ => [
‘display’ => ‘advanced’,
‘query’ => ‘advanced’
]
);
return $templates;
}
add_filter( ‘facetwp_templates’, ‘register_listings_template’ );
{{/gist}}