From 4be74d96ee9b3844ac18cc0e1ff9ae66618fcdbb Mon Sep 17 00:00:00 2001 From: David Naber Date: Sun, 7 Feb 2016 16:26:24 +0100 Subject: [PATCH] Introduce PostTypeBlacklistFilter #49 --- inc/Import/Filter/BlacklistPostTypeFilter.php | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 inc/Import/Filter/BlacklistPostTypeFilter.php diff --git a/inc/Import/Filter/BlacklistPostTypeFilter.php b/inc/Import/Filter/BlacklistPostTypeFilter.php new file mode 100644 index 0000000..7bfc50f --- /dev/null +++ b/inc/Import/Filter/BlacklistPostTypeFilter.php @@ -0,0 +1,53 @@ +blacklist = $blacklist; + $this->filter = $filter + ? $filter + : new PostPassThroughFilter; + } + /** + * Checks if a post should be imported or not + * + * @param Type\ImportPostInterface $import_post + * + * @return bool + */ + public function post_to_import( Type\ImportPostInterface $import_post ) { + + if ( ! in_array( $import_post->type(), $this->blacklist ) ) + return FALSE; + + return $this->filter->post_to_import( $import_post ); + } + +} \ No newline at end of file