array( $this, 'aesop_post_gallery' ) ) ); } } /** * Main gallery component * * @since 1.0.0 */ public function aesop_post_gallery( $atts ) { global $post; // attributes $defaults = array( 'id' => '', 'revealfx' => 'off' ); $atts = shortcode_atts( $defaults, $atts ); // gallery ID $gallery_id = isset( $atts['id'] ) ? (int) $atts['id'] : false; // alias to new atts type // let this be used multiple times static $instance = 0; $instance++; $unique = sprintf( '%s-%s', $gallery_id, $instance ); // get gallery images and custom attrs $image_ids = get_post_meta( $gallery_id, '_ase_gallery_images', true ); $image_ids = array_map( 'intval', explode( ',', $image_ids ) ); $type = get_post_meta( $gallery_id, 'aesop_gallery_type', true ); $width = get_post_meta( $gallery_id, 'aesop_gallery_width', true ); // gallery caption $gallery_caption = get_post_meta( $gallery_id, 'aesop_gallery_caption', true ); // custom classes $classes = aesop_component_classes( 'gallery', '' ); ob_start(); do_action( 'aesop_gallery_before', $type, $gallery_id, $atts, $unique ); // action $hidden =""; if (aesop_revealfx_set($atts) && $type != 'stacked') { $hidden ='style="visibility:hidden;"'; } ?> instead of
with * `background-image`. * Note that the AMP spec calls for instead of , * but output here and rely on the AMP plugin to replace * the tags properly. * @link https://wordpress.org/plugins/amp/ * @link https://www.ampproject.org/docs/reference/spec.html */ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) { $size = apply_filters( 'aesop_stacked_gallery_size', 'full' ); foreach ( $image_ids as $image_id ): $full = wp_get_attachment_image_src( $image_id, $size, false ); $caption = get_post( $image_id )->post_excerpt; $alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true ); ?>
<?php echo esc_attr( $alt );?>
post_excerpt; ?>
post_excerpt; // lazy loading disabled for now //$lazy = class_exists( 'AesopLazyLoader' ) ? sprintf( 'src="%s" data-src="%s" class="aesop-sequence-img aesop-lazy-img"', $lazy_holder, esc_url( $img[0] ) ) : sprintf( 'src="%s" class="aesop-sequence-img" ', esc_url( $img[0] ) ); $lazy = sprintf( 'src="%s" class="aesop-sequence-img" ', esc_url( $img[0] ) ); ?>
alt="">
add_action( 'wp_footer', aesop_panorama, 20 ); post_excerpt; ?>
<?php echo esc_attr( $alt );?>
post_excerpt; // lazy loading disabled for now //$lazy = class_exists( 'AesopLazyLoader' ) ? sprintf( 'src="%s" data-src="%s" class="aesop-sequence-img aesop-lazy-img"', $lazy_holder, esc_url( $img[0] ) ) : sprintf( 'src="%s" class="aesop-sequence-img" ', esc_url( $img[0] ) ); $lazy = sprintf( 'src="%s" class="aesop-sequence-img" ', esc_url( $img[0] ) ); if (!$sequence_panorama) { ?>
alt="">
<?php echo esc_attr( $alt );?>
'; } ?>'; } } /** * Draws a hero gallery using fotorama * * @since 1.0.0 */ public function aesop_hero_gallery( $gallery_id, $image_ids, $width ) { $trans = get_post_meta( $gallery_id, 'aesop_hero_gallery_transition', true ); $trans_speed = get_post_meta( $gallery_id, 'aesop_hero_gallery_transition_speed', true ); $trans_anim_speed = get_post_meta( $gallery_id, 'aesop_hero_gallery_transition_anim_speed', true ); // if hero option is not set use the thumb gallery option $trans = $trans ? $trans : get_post_meta( $gallery_id, 'aesop_thumb_gallery_transition', true ); $trans_speed = $trans_speed ? $trans_speed : get_post_meta( $gallery_id, 'aesop_thumb_gallery_transition_speed', true ); $trans_speed = $trans_speed ? $trans_speed : 3000; $trans_anim_speed = $trans_anim_speed ? $trans_anim_speed : 1200; $autoplay = sprintf( 'data-autoplay=%s', $trans_speed, true ); $transition = $trans ? $trans : 'crossfade'; $content = get_post_meta( $gallery_id, 'aesop_hero_gallery_content', true ) ? get_post_meta( $gallery_id, 'aesop_hero_gallery_content', true) : ''; $height = get_post_meta( $gallery_id, 'aesop_hero_gallery_height', true ) ? get_post_meta( $gallery_id, 'aesop_hero_gallery_height', true) : ''; $enable_nav = get_post_meta( $gallery_id, 'aesop_hero_gallery_enable_nav', true ) ? get_post_meta( $gallery_id, 'aesop_hero_gallery_enable_nav', true) : false; $image_text_op = get_post_meta( $gallery_id, 'aesop_hero_image_text', true ) ? get_post_meta( $gallery_id, 'aesop_hero_image_text', true) : false; // image size $size = apply_filters( 'aesop_thumb_gallery_size', 'full' ); if (empty($width)) { $width = "100%"; } if (empty($height)) { $height = "100%"; } else { if (strpos($height, '/') !== FALSE) { $ratio = 'data-ratio="'.$height.'"'; $height =""; } } ?>