Code Duplication    Length = 61-61 lines in 2 locations

includes/save_gallery.php 1 location

@@ 15-75 (lines=61) @@
12
	/**
13
	 * Update an existing galleries options
14
	 */
15
	public static function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
16
17
		// gallery width
18
		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
19
20
		// gallery grid item width
21
		$item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false;
22
23
		// caption
24
		$caption = isset( $options['caption'] ) ? $options['caption'] : false;
25
26
		// gallery transition
27
		$transition = isset( $options['transition'] ) ? $options['transition'] : false;
28
29
		// gallery transition speed
30
		$transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false;
31
32
		// gallery hide thumbs
33
		$hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false;
34
35
		// photoset layout hardwired to on for now
36
		$psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false;
37
38
		// photoset layout
39
		$psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
40
		
41
		// hero gallery height
42
		$gallery_height = isset( $options['height'] ) ? $options['height'] : false;
43
44
		// update gallery ids
45
		if ( !empty( $gallery_ids ) ) {
46
47
			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
48
49
		}
50
51
		update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) );
52
53
		update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) );
54
55
		update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) );
56
57
		update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) );
58
59
		update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) );
60
61
		update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) );
62
63
		update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) );
64
65
		update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) );
66
67
		update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) );
68
		
69
		update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) );
70
		
71
		//hardwired for now
72
		
73
		update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 );
74
75
	}
76
77
}
78

public/includes/lasso.php 1 location

@@ 730-790 (lines=61) @@
727
        exit;
728
	}
729
    
730
    public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) {
731
732
		// gallery width
733
		$gallery_width = isset( $options['width'] ) ? $options['width'] : false;
734
735
		// gallery grid item width
736
		$item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false;
737
738
		// caption
739
		$caption = isset( $options['caption'] ) ? $options['caption'] : false;
740
741
		// gallery transition
742
		$transition = isset( $options['transition'] ) ? $options['transition'] : false;
743
744
		// gallery transition speed
745
		$transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false;
746
747
		// gallery hide thumbs
748
		$hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false;
749
750
		// photoset layout hardwired to on for now
751
		$psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false;
752
753
		// photoset layout
754
		$psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false;
755
		
756
		// hero gallery height
757
		$gallery_height = isset( $options['height'] ) ? $options['height'] : false;
758
759
		// update gallery ids
760
		if ( !empty( $gallery_ids ) ) {
761
762
			update_post_meta( $postid, '_ase_gallery_images', $gallery_ids );
763
764
		}
765
766
		update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) );
767
768
		update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) );
769
770
		update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) );
771
772
		update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) );
773
774
		update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) );
775
776
		update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) );
777
778
		update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) );
779
780
		update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) );
781
782
		update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) );
783
		
784
		update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) );
785
		
786
		//hardwired for now
787
		
788
		update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 );
789
790
	}
791
	
792
	function getEnglishMonthName($foreignMonthName){
793