array(), 'video' => '', 'size' => 'full', ); $args = wp_parse_args( $args, $defaults ); if( count( $args['images'] ) >= 1 || $args['video'] ) { do_action( 'fusion_before_slideshow' ); if( $args['video'] ) { echo $this->add_slide( array( 'type' => 'video', 'video_code' => $args['video'], ) ); } foreach( $args['images'] as $image_id ) { echo $this->add_slide( array( 'type' => 'image', 'id' => (int) $image_id, 'link' => true, 'lightbox' => true, 'size' => $args['size'], ) ); } do_action( 'fusion_end_slideshow' ); } } // end slideshow() function before_slideshow() { echo '
' . "\n"; echo ''; echo '
' . "\n"; } // end_slideshow() function slideshow_attr( $post_id ) { $attr['class'] = 'post-slideshow fusion-flexslider flexslider'; return $attr; } // end slideshow_attr() function add_slide( $args ) { $defaults = array( 'type' => 'image', 'id' => '', 'link' => true, 'lightbox' => true, 'size' => 'full', 'video_code' => '', ); $args = wp_parse_args( $args, $defaults ); $html = '
  • '; if( $args['type'] == 'image' ) { $image_url = wp_get_attachment_image_src( $args['id'], $args['size'] ); $lightbox_image_url = wp_get_attachment_image_src( $args['id'], 'full' ); $title = get_post_field( 'post_excerpt', $args['id'] ); $alt = get_post_meta( $args['id'], '_wp_attachment_image_alt', true ); $image = sprintf( '%s', $image_url[0], $alt ); $html .= $link = sprintf( '%s', $lightbox_image_url[0], 'lightbox', $title, $alt, $image ); } elseif( $args['type'] == 'video' ) { $html .= '
    '.$args['video_code'].'
    '; } $html .= '
  • '; return $html; } // end add_slide() } // end FusionTemplateSlideshow() class }