Skip to content

Commit

Permalink
Merge pull request #3420 from 10up/fix/issue-3401
Browse files Browse the repository at this point in the history
Meta and Meta Range facets only available on WP 5.8+
  • Loading branch information
felipeelia authored Apr 3, 2023
2 parents 24fb01b + df48200 commit 6a43f63
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions includes/classes/Feature/Facets/Facets.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,14 @@ public function __construct() {
];

$types = [
'taxonomy' => __NAMESPACE__ . '\Types\Taxonomy\FacetType',
'meta' => __NAMESPACE__ . '\Types\Meta\FacetType',
'meta-range' => __NAMESPACE__ . '\Types\MetaRange\FacetType',
'taxonomy' => __NAMESPACE__ . '\Types\Taxonomy\FacetType',
];

if ( version_compare( get_bloginfo( 'version' ), '5.8', '>=' ) ) {
$types['meta'] = __NAMESPACE__ . '\Types\Meta\FacetType';
$types['meta-range'] = __NAMESPACE__ . '\Types\MetaRange\FacetType';
}

/**
* Filter the Facet types available.
*
Expand Down

0 comments on commit 6a43f63

Please sign in to comment.