Skip to content

Commit

Permalink
Added options filters for specific post type and taxonomy (#2319)
Browse files Browse the repository at this point in the history
  • Loading branch information
GheorgheP authored and moldcraft committed Jan 13, 2017
1 parent b5a9acf commit ede7488
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions framework/core/components/theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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
);

Expand Down

0 comments on commit ede7488

Please sign in to comment.