Skip to content

Commit

Permalink
clean up un-used vars
Browse files Browse the repository at this point in the history
  • Loading branch information
Bearded Avenger committed Aug 14, 2014
1 parent 4caa3d7 commit 74e0c9b
Showing 1 changed file with 32 additions and 40 deletions.
72 changes: 32 additions & 40 deletions public/includes/components/component-gallery.php
Expand Up @@ -113,11 +113,10 @@ function aesop_post_gallery($atts, $content = null){
*/
function aesop_thumb_gallery($gallery_id, $image_ids, $width){

$thumbs = get_post_meta( $gallery_id, 'aesop_thumb_gallery_hide_thumbs', true) ? sprintf('data-nav="false"') : sprintf('data-nav="thumbs"');
$thumbs = get_post_meta( $gallery_id, 'aesop_thumb_gallery_hide_thumbs', true) ? sprintf('data-nav="false"') : sprintf('data-nav="thumbs"');
$autoplay = get_post_meta( $gallery_id, 'aesop_thumb_gallery_transition_speed', true) ? sprintf('data-autoplay="%s"', get_post_meta( $gallery_id, 'aesop_thumb_gallery_transition_speed', true)) : null;
$transition = get_post_meta( $gallery_id, 'aesop_thumb_gallery_transition', true) ? get_post_meta( $gallery_id, 'aesop_thumb_gallery_transition', true) : 'slide';


?><div id="aesop-thumb-gallery-<?php echo $atts['id'];?>" class="fotorama" data-transition="crossfade"
data-width="<?php echo $width;?>"
<?php echo $autoplay;?>
Expand Down Expand Up @@ -175,8 +174,6 @@ function aesop_grid_gallery($gallery_id, $image_ids, $width){

$getimage = wp_get_attachment_image($image_id, 'aesop-grid-image', false, array('class' => 'aesop-grid-image'));
$getimgsrc = wp_get_attachment_image_src($image_id,'large');
$caption = $image_id->post_excerpt;
$desc = $image_id->post_content;
$img_title = $image_id->post_title;

printf('<a class="aesop-lightbox" href="%s" title="%s"><span class="clearfix">%s</span></a>',$getimgsrc[0], esc_attr($img_title), $getimage);
Expand Down Expand Up @@ -217,9 +214,7 @@ function aesop_stacked_gallery( $gallery_id, $image_ids, $width, $unique){
foreach ( $image_ids as $image_id ):

$full = wp_get_attachment_url($image_id, 'full', false,'');
$alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
$caption = $image_id->post_excerpt;
$desc = $image_id->post_content;

?>
<div class="aesop-stacked-img" style="background-image:url('<?php echo $full;?>');<?php echo $styles;?>">
Expand All @@ -238,14 +233,13 @@ function aesop_stacked_gallery( $gallery_id, $image_ids, $width, $unique){
*
* @since 1.0.0
*/
function aesop_sequence_gallery($gallery_id, $image_ids, $width){
function aesop_sequence_gallery( $gallery_id, $image_ids, $width ){

foreach ($image_ids as $image_id):
foreach ( $image_ids as $image_id ):

$img = wp_get_attachment_url($image_id, 'large', false,'');
$img = wp_get_attachment_url($image_id, 'large', false,'');
$alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
$caption = $image_id->post_excerpt;
$desc = $image_id->post_content;

?>
<figure class="aesop-sequence-img-wrap">
Expand Down Expand Up @@ -278,48 +272,48 @@ function aesop_sequence_gallery($gallery_id, $image_ids, $width){
function aesop_photoset_gallery($gallery_id, $image_ids, $width){

// allow theme developers to determine the spacing between grid items
$space = apply_filters('aesop_grid_gallery_spacing', 5);
$space = apply_filters('aesop_grid_gallery_spacing', 5);

// layout
$layout = get_post_meta( $gallery_id, 'aesop_photoset_gallery_layout', true) ? get_post_meta( $gallery_id, 'aesop_photoset_gallery_layout', true) : '';

$style = $width ? sprintf('style="max-width:%s;margin-left:auto;margin-right:auto;"',$width) : null;
$style = $width ? sprintf('style="max-width:%s;margin-left:auto;margin-right:auto;"', $width) : null;

// lightbox
$lightbox = get_post_meta( $gallery_id, 'aesop_photoset_gallery_lightbox', true );

?>
<!-- Aesop Photoset Gallery -->
<script>
jQuery(window).load(function(){
jQuery('.aesop-gallery-photoset').photosetGrid({
gutter: "<?php echo $space.'px';?>",
<?php if ( $lightbox ) { ?>
highresLinks:true,
<?php } ?>
onComplete: function(){
jQuery(window).load(function(){
jQuery('.aesop-gallery-photoset').photosetGrid({
gutter: "<?php echo $space.'px';?>",
<?php if ( $lightbox ) { ?>
highresLinks:true,
<?php } ?>
onComplete: function(){

<?php if ( $lightbox ) { ?>
jQuery('.aesop-gallery-photoset a').addClass('aesop-lightbox').prepend('<i class="dashicons dashicons-search"></i>');
<?php if ( $lightbox ) { ?>
jQuery('.aesop-gallery-photoset a').addClass('aesop-lightbox').prepend('<i class="dashicons dashicons-search"></i>');

<?php } ?>
<?php } ?>

jQuery('.aesop-gallery-photoset').attr('style', '');
jQuery(".aesop-gallery-photoset img").each(function(){
jQuery('.aesop-gallery-photoset').attr('style', '');
jQuery(".aesop-gallery-photoset img").each(function(){

caption = jQuery(this).attr('alt');
caption = jQuery(this).attr('alt');

if ( caption ) {
title = jQuery(this).attr('data-title');
jQuery(this).after('<span class="aesop-photoset-caption"><span class="aesop-photoset-caption-title">' + title + '</span><span class="aesop-photoset-caption-caption">' + caption +'</span></span>');
jQuery('.aesop-photoset-caption').hide().fadeIn();
if ( caption ) {
title = jQuery(this).attr('data-title');
jQuery(this).after('<span class="aesop-photoset-caption"><span class="aesop-photoset-caption-title">' + title + '</span><span class="aesop-photoset-caption-caption">' + caption +'</span></span>');
jQuery('.aesop-photoset-caption').hide().fadeIn();

jQuery(this).closest('a').attr('title',title);
}
});
}
jQuery(this).closest('a').attr('title',title);
}
});
}
});
});
});
</script>

<?php if ( $style ) {
Expand All @@ -328,17 +322,15 @@ function aesop_photoset_gallery($gallery_id, $image_ids, $width){

?><div class="aesop-gallery-photoset" data-layout="<?php echo $layout;?>" ><?php

foreach ($image_ids as $image_id):
foreach ( $image_ids as $image_id ):

$full = wp_get_attachment_url($image_id, 'large', false, '');
$alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
$caption = $image_id->post_excerpt;
$desc = $image_id->post_content;
$full = wp_get_attachment_url( $image_id, 'large', false, '' );
$alt = get_post_meta( $image_id, '_wp_attachment_image_alt', true );
$title = $image_id->post_title;

$lb_link = $lightbox ? sprintf('data-highres="%s"', $full) : null;

?><img src="<?php echo $full;?>" <?php echo $lb_link;?> data-title="<?php echo $title;?>" alt="<?php echo $alt;?>"><?php
?><img src="<?php echo $full;?>" <?php echo $lb_link;?> data-title="<?php echo $title;?>" title="<?php echo $title;?>" alt="<?php echo $alt;?>"><?php

endforeach;

Expand Down

0 comments on commit 74e0c9b

Please sign in to comment.