'', ), $atts)); if (!$id){ $shortcodeContent = "
You need to provide an ID to the gallery shortcode to display a gallery.
"; }else{ $galleryID = esc_html($id); $post_meta_data = get_post_custom($galleryID); $custom_repeatables = unserialize($post_meta_data['artistpress_images'][0]); $galleryTitle = get_the_title($galleryID); $galleryLink = get_the_permalink($galleryID); $gallery_options = get_option('artistpress_gallery_settings'); $galleryOptionTitle = sanitize_text_field($gallery_options['gallery_show_title']); $galleryOptionBehavior = sanitize_text_field($gallery_options['gallery_behavior']); $galleryOptionCaption = sanitize_text_field($gallery_options['gallery_show_image_caption']); $galleryOptionImageTitle = sanitize_text_field($gallery_options['gallery_show_image_title']); $galleryOptionStyles = sanitize_text_field($gallery_options['gallery_use_gallery_stylesheet']); $shortcodeContent = NULL; // Registers jquery if it is not provided by theme. if ( ! wp_script_is( 'jquery', 'enqueued' )) { wp_enqueue_script( 'jquery' ); } if( $galleryOptionBehavior == 'masonrylightbox' ) { wp_enqueue_style( 'masonry-style'); wp_enqueue_script( 'masonry-js'); wp_enqueue_script( 'masonry-start'); } wp_enqueue_style( 'gallery-lightbox' ); wp_enqueue_script( 'gallery-lightbox-js' ); if( $galleryOptionStyles == 'yes'){ wp_enqueue_style( 'gallery-styles'); } if( $galleryOptionTitle == 'yes'){ $shortcodeContent .= '