plugins_url( 'theme_files/styles.css', __FILE__ ), 'speed' => self::$shortcode_options['speed'], 'timeout' => self::$shortcode_options['timeout'], 'fx' => self::$shortcode_options['fx'], 'style' => self::$shortcode_options['style'], 'width' => self::$shortcode_options['width'], 'height' => self::$shortcode_options['height'], ) ); wp_localize_script( 'jquery-cycle', __CLASS__, $plugin_js_data ); // localize after target wp_print_scripts( 'abt-heroes-init' ); // need to print at least one? } function shortcode_slider( $atts, $content = null, $code = "" ) { // $atts ::= array of attributes // $content ::= text within enclosing form of shortcode element // $code ::= the shortcode found, when == callback name // examples: [my-shortcode] // [my-shortcode/] // [my-shortcode foo='bar'] // [my-shortcode foo='bar'/] // [my-shortcode]content[/my-shortcode] // [my-shortcode foo='bar']content[/my-shortcode] // pass options on to footer script self::$shortcode_options = shortcode_atts( array( 'width' => '100%', 'height' => '400px', 'order' => 'asc', 'orderby' => 'menu_order', 'speed' => 600, 'timeout' => 7000, 'classes' => '', 'postType' => $this->postType, 'style' => 'photo', // | thumbnail 'fx' => 'fade', // shuffle, zoom, fade, turnDown, curtainX, scrollRight ), $atts ); extract( self::$shortcode_options ); $my_query = new WP_Query( array( 'post_type' => $postType, 'orderby' => $orderby, 'order' => $order, ) ); //don't do the rest if we don't have heroes if ( !$my_query->have_posts() ) return ''; //jedi trigger for page styles - see abt_featured_content self::$add_script = true; // must return the output! use the following to intercept nicely formatted html ob_start(); // check for theme override, otherwise use default template if ( '' == ( $template_file = locate_template( 'hero-slider-content.php' ) ) ) { $template_file = 'theme_files/hero-slider-content.php'; } include( $template_file ); // return the output (and stop the buffer) return ob_get_clean(); } /** * Dump the slider (using the shortcode, internally) * @param array $atts {optional} override shortcode parameters */ public static function embed( $atts = array() ) { //build attribute string $att_str = ''; foreach ( $atts as $att => $value ) { $att_str .= " $att=\"$value\""; } echo ''; }//-- fn embed } //instantiate new abt_featured_heroes(); ?>