Skip to content

Commit

Permalink
Merge pull request #2779 from 10up/fix/undefined-index-facet-renderer
Browse files Browse the repository at this point in the history
Set some default args and instance values
  • Loading branch information
felipeelia authored May 20, 2022
2 parents 61b3e25 + b58b97f commit 955aeb6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions includes/classes/Feature/Facets/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ class Renderer {
public function render( $args, $instance ) {
global $wp_query;

$args = wp_parse_args(
$args,
[
'before_widget' => '',
'before_title' => '',
'after_title' => '',
'after_widget' => '',
]
);
$instance = wp_parse_args(
$instance,
[
'title' => '',
]
);

$feature = Features::factory()->get_registered_feature( 'facets' );

if ( $wp_query->get( 'ep_facet', false ) && ! $feature->is_facetable( $wp_query ) ) {
Expand Down

0 comments on commit 955aeb6

Please sign in to comment.