'ASC', 'orderby' => 'menu_order ID', 'id' => $post ? $post->ID : 0, 'size' => 'large', 'include' => '', 'exclude' => '', // bgbn slider 'bgbn_slider' => true, 'bgbn_autoplay' => false, 'bgbn_prevnext' => false, 'bgbn_pager' => false, 'bgbn_delay' => 6000, 'bgbn_effect' => 'scrollHorz' ), $attr, 'gallery'); $attr['id'] = intval( $attr['id'] ); if ( 'RAND' == $attr['order'] ) { $attr['orderby'] = 'none'; } if ( !empty( $attr['include'] ) ) { $_attachments = get_posts( array( 'include' => $attr['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $attr['order'], 'orderby' => $attr['orderby'] ) ); $attachments = array(); foreach ( $_attachments as $key => $val ) { $attachments[ $val->ID ] = $_attachments[ $key ]; } } elseif ( !empty( $attr['exclude'] ) ) { $attachments = get_children( array( 'post_parent' => $attr['id'], 'exclude' => $attr['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $attr['order'], 'orderby' => $attr['orderby'] ) ); } else { $attachments = get_children( array( 'post_parent' => $attr['id'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $attr['order'], 'orderby' => $attr['orderby'] ) ); } if ( empty( $attachments ) ) { return ''; } if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $att_id => $attachment ) { $output .= wp_get_attachment_link( $att_id, $attr['size'], true ) . "\n"; } return $output; } // End core code // Classes $classes = 'bgbn-shortcode-slider cycle-slideshow'; // Data attributes $data_attributes = ' data-cycle-log="false"'; $data_attributes .= ' data-cycle-slides=".cycle-slide"'; $data_attributes .= ' data-cycle-auto-height="calc"'; $data_attributes .= ' data-cycle-center-horz="true"'; $data_attributes .= ' data-cycle-center-vert="true"'; $data_attributes .= ' data-cycle-swipe="true"'; // No autoplay $autoplay = (bool) $attr['bgbn_autoplay']; if ( false === $autoplay ) { $data_attributes .= ' data-cycle-paused="true"'; } // Delay $delay = absint( $attr['bgbn_delay'] ); if ( 0 === $delay ) { $delay = 6000; } if ( 4000 !== $delay ) { $data_attributes .= ' data-cycle-timeout="' . esc_attr( $delay ) . '"'; } // Effect $effect = trim( $attr['bgbn_effect'] ); if ( ! in_array( $effect, array( 'fade', 'scrollHorz', 'none' ) ) ) { $effect = 'scrollHorz'; } if ( 'fade' !== $effect ) { $data_attributes .= ' data-cycle-fx="' . esc_attr( $effect ) . '"'; } // Markup ob_start(); ?>
> $attachment ) : ?>
post_excerpt ) ) : ?>
post_excerpt ); ?>