From ede7488fe04d40eb5f9aa4dd6b12425584bd3fe4 Mon Sep 17 00:00:00 2001 From: Gheorghe Date: Fri, 13 Jan 2017 16:13:37 +0200 Subject: [PATCH] Added options filters for specific post type and taxonomy (#2319) --- framework/core/components/theme.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/framework/core/components/theme.php b/framework/core/components/theme.php index 057ea682..2f6bbd01 100644 --- a/framework/core/components/theme.php +++ b/framework/core/components/theme.php @@ -111,7 +111,11 @@ public function get_post_options($post_type) try { return FW_Cache::get($cache_key); } catch (FW_Cache_Not_Found_Exception $e) { - $options = apply_filters('fw_post_options', $this->get_options('posts/'. $post_type), $post_type); + $options = apply_filters( + 'fw_post_options', + apply_filters( "fw_post_options:$post_type", $this->get_options( 'posts/' . $post_type ) ), + $post_type + ); FW_Cache::set($cache_key, $options); @@ -126,8 +130,9 @@ public function get_taxonomy_options($taxonomy) try { return FW_Cache::get($cache_key); } catch (FW_Cache_Not_Found_Exception $e) { - $options = apply_filters('fw_taxonomy_options', - $this->get_options('taxonomies/'. $taxonomy), + $options = apply_filters( + 'fw_taxonomy_options', + apply_filters( "fw_taxonomy_options:$taxonomy", $this->get_options( 'taxonomies/' . $taxonomy ) ), $taxonomy );