This repository has been archived by the owner on Nov 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Controller\MetaFilterApi #56
- Loading branch information
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php # -*- coding: utf-8 -*- | ||
|
||
namespace W2M\Controller; | ||
|
||
use | ||
W2M\Import\Data; | ||
|
||
/** | ||
* Class MetaFilterApi | ||
* | ||
* Applies w2m_import_meta_filter to the meta filter list to allow | ||
* third party code to adapt the filters. | ||
* | ||
* @package W2M\Controller | ||
*/ | ||
class MetaFilterApi { | ||
|
||
/** | ||
* @var Data\MetaFilterListInterface | ||
*/ | ||
private $filter_list; | ||
|
||
private $postponed_filter_list; | ||
|
||
/** | ||
* @param Data\MetaFilterListInterface $filter_list | ||
* @param $postponed_filter_list (Todo: specify implement this) | ||
*/ | ||
public function __construct( | ||
Data\MetaFilterListInterface $filter_list, | ||
$postponed_filter_list = NULL | ||
) { | ||
|
||
$this->filter_list = $filter_list; | ||
$this->postponed_filter_list = $postponed_filter_list; | ||
} | ||
|
||
/** | ||
* Applies w2m_import_meta_filter to the meta filter list to allow | ||
* third party code to adapt the filters. | ||
*/ | ||
public function register_filter() { | ||
|
||
/** | ||
* Use this hook to register filters to specific meta keys for specific | ||
* element types | ||
* | ||
* @see \W2M\Import\Filter\ValueFilterableInterface | ||
* | ||
* @param Data\MetaFilterListInterface | ||
*/ | ||
do_action( 'w2m_import_meta_filter', $this->filter_list ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters