Skip to content

Commit

Permalink
Merge pull request #2919 from 10up/feature/facet-types
Browse files Browse the repository at this point in the history
Move taxonomy facets to a separate class
  • Loading branch information
felipeelia authored Aug 25, 2022
2 parents 9bd88db + c313c4a commit 5f4845b
Show file tree
Hide file tree
Showing 15 changed files with 770 additions and 207 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2,
"title": "Facet (ElasticPress)",
"title": "Facet by Taxonomy (ElasticPress)",
"textdomain": "elasticpress",
"name": "elasticpress/facet",
"icon": "feedback",
Expand All @@ -25,6 +25,6 @@
"supports": {
"html": false
},
"editorScript": "file:/../../../../dist/js/facets-block-script.min.js",
"style": "file:/../../../../dist/css/facets-styles.min.css"
"editorScript": "file:/../../../../../dist/js/facets-block-script.min.js",
"style": "file:/../../../../../dist/css/facets-styles.min.css"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions includes/classes/Feature/Facets/FacetType.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php
/**
* Taxonomy facet type
*
* @since 4.3.0
* @package elasticpress
*/

namespace ElasticPress\Feature\Facets;

/**
* Abstract Facet type class
*
* Keeping this as an abstract class (and not an interface) to make
* the implementation of common methods easier.
*/
abstract class FacetType {

/**
* Setup hooks and filters for feature
*/
abstract public function setup();

/**
* Get the facet filter name.
*
* @return string The filter name.
*/
abstract public function get_filter_name() : string;

/**
* Get the facet filter type.
*
* @return string The filter name.
*/
abstract public function get_filter_type() : string;
}
Loading

0 comments on commit 5f4845b

Please sign in to comment.