| @@ 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 | ||
| @@ 776-836 (lines=61) @@ | ||
| 773 | exit; |
|
| 774 | } |
|
| 775 | ||
| 776 | public function save_gallery_options( $postid, $gallery_ids, $options, $type = false ) { |
|
| 777 | ||
| 778 | // gallery width |
|
| 779 | $gallery_width = isset( $options['width'] ) ? $options['width'] : false; |
|
| 780 | ||
| 781 | // gallery grid item width |
|
| 782 | $item_width = isset( $options['itemwidth'] ) ? $options['itemwidth'] : false; |
|
| 783 | ||
| 784 | // caption |
|
| 785 | $caption = isset( $options['caption'] ) ? $options['caption'] : false; |
|
| 786 | ||
| 787 | // gallery transition |
|
| 788 | $transition = isset( $options['transition'] ) ? $options['transition'] : false; |
|
| 789 | ||
| 790 | // gallery transition speed |
|
| 791 | $transitionSpeed = isset( $options['speed'] ) ? $options['speed'] : false; |
|
| 792 | ||
| 793 | // gallery hide thumbs |
|
| 794 | $hideThumbs = isset( $options['hideThumbs'] ) ? $options['hideThumbs'] : false; |
|
| 795 | ||
| 796 | // photoset layout hardwired to on for now |
|
| 797 | $psLayout = isset( $options['pslayout'] ) ? $options['pslayout'] : false; |
|
| 798 | ||
| 799 | // photoset layout |
|
| 800 | $psLightbox = 'on';//isset( $options['pslightbox'] ) ? $options['pslightbox'] : false; |
|
| 801 | ||
| 802 | // hero gallery height |
|
| 803 | $gallery_height = isset( $options['height'] ) ? $options['height'] : false; |
|
| 804 | ||
| 805 | // update gallery ids |
|
| 806 | if ( !empty( $gallery_ids ) ) { |
|
| 807 | ||
| 808 | update_post_meta( $postid, '_ase_gallery_images', $gallery_ids ); |
|
| 809 | ||
| 810 | } |
|
| 811 | ||
| 812 | update_post_meta( $postid, 'aesop_gallery_type', sanitize_text_field( trim( $type ) ) ); |
|
| 813 | ||
| 814 | update_post_meta( $postid, 'aesop_gallery_width', sanitize_text_field( trim( $gallery_width ) ) ); |
|
| 815 | ||
| 816 | update_post_meta( $postid, 'aesop_grid_gallery_width', sanitize_text_field( trim( $item_width ) ) ); |
|
| 817 | ||
| 818 | update_post_meta( $postid, 'aesop_gallery_caption', sanitize_text_field( trim( $caption ) ) ); |
|
| 819 | ||
| 820 | update_post_meta( $postid, 'aesop_thumb_gallery_transition', sanitize_text_field( trim( $transition ) ) ); |
|
| 821 | ||
| 822 | update_post_meta( $postid, 'aesop_thumb_gallery_transition_speed', absint( trim( $transitionSpeed ) ) ); |
|
| 823 | ||
| 824 | update_post_meta( $postid, 'aesop_thumb_gallery_hide_thumbs', sanitize_text_field( trim( $hideThumbs ) ) ); |
|
| 825 | ||
| 826 | update_post_meta( $postid, 'aesop_photoset_gallery_layout', sanitize_text_field( trim( $psLayout ) ) ); |
|
| 827 | ||
| 828 | update_post_meta( $postid, 'aesop_photoset_gallery_lightbox', sanitize_text_field( trim( $psLightbox ) ) ); |
|
| 829 | ||
| 830 | update_post_meta( $postid, 'aesop_hero_gallery_height', sanitize_text_field( trim( $gallery_height ) ) ); |
|
| 831 | ||
| 832 | //hardwired for now |
|
| 833 | ||
| 834 | update_post_meta( $postid, 'aesop_hero_gallery_transition_speed', 300 ); |
|
| 835 | ||
| 836 | } |
|
| 837 | ||
| 838 | function getEnglishMonthName($foreignMonthName){ |
|
| 839 | ||