Skip to content

Commit

Permalink
chapter/timeline location filters
Browse files Browse the repository at this point in the history
filters to determine where chapter and timeline can be loaded. useful for using on pages.
  • Loading branch information
Bearded Avenger committed Aug 5, 2014
1 parent a6944b0 commit 3a5db2b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion public/includes/components/component-heading.php
Expand Up @@ -105,7 +105,10 @@ function aesop_chapter_heading_loader() {

global $post;

if( isset($post->post_content) && is_single() && has_shortcode( $post->post_content, 'aesop_chapter') ) {
$default_location = is_single();
$location = apply_filters( 'aesop_chapter_component_appears', $default_location );

if( isset($post->post_content) && ( $location ) && has_shortcode( $post->post_content, 'aesop_chapter') ) {

new AesopChapterHeadingComponent;

Expand Down
5 changes: 4 additions & 1 deletion public/includes/components/component-timeline.php
Expand Up @@ -33,7 +33,10 @@ function aesop_timeline_class_loader() {

global $post;

if ( function_exists('aesop_component_exists') && aesop_component_exists('timeline_stop') && is_single() ) {
$default_location = is_single();
$location = apply_filters( 'aesop_timeline_component_appears', $default_location );

if ( function_exists('aesop_component_exists') && aesop_component_exists('timeline_stop') && ( $location ) ) {

new AesopTimelineComponent;

Expand Down

0 comments on commit 3a5db2b

Please sign in to comment.