'2007', 'title' => '' ); $atts = apply_filters( 'aesop_timeline_defaults', shortcode_atts( $defaults, $atts ) ); // let this be used multiple times static $instance = 0; $instance++; $unique = sprintf( '%s-%s', get_the_ID(), $instance ); $datatitle = $atts['title'] ? sprintf( 'data-title="%s"', esc_attr( $atts['title'] ) ) : null; // actions $actiontop = do_action( 'aesop_timeline_before', $atts, $unique ); // action $actionbottom = do_action( 'aesop_timeline_after', $atts, $unique ); // action $out = sprintf( '%s

%s

%s', $actiontop, $datatitle, aesop_component_data_atts( 'timeline_stop', $unique, $atts ), esc_html( $atts['num'] ), $actionbottom ); return apply_filters( 'aesop_timeline_output', $out ); } }//end if if ( ! function_exists( 'aesop_timeline_class_loader' ) ) { add_action( 'wp', 'aesop_timeline_class_loader', 11 ); // has to run after components are loaded function aesop_timeline_class_loader() { global $post; $default_location = is_single() || is_page(); $location = apply_filters( 'aesop_timeline_component_appears', $default_location ); if ( function_exists( 'aesop_component_exists' ) && aesop_component_exists( 'timeline_stop' ) && ( $location ) ) { new AesopTimelineComponent; } } } class AesopTimelineComponent { public function __construct() { // call our method in the footer add_action( 'wp_footer', array( $this, 'aesop_timeline_loader' ), 21 ); // add a body class if timeline is active add_filter( 'body_class', array( $this, 'body_class' ) ); } public function aesop_timeline_loader() { // allow theme developers to determine the offset amount $timelineOffset = apply_filters( 'aesop_timeline_scroll_offset', 0 ); // filterable content class $postClass = get_post_class(); if (in_array ( 'aesop-entry-content', $postClass ) ) { $contentClass = '.aesop-entry-content'; } else { $contentClass = apply_filters( 'aesop_chapter_scroll_container', '.entry-content' ); } // filterable target class $appendTo = apply_filters( 'aesop_timeline_scroll_nav', '.aesop-timeline' ); ?>