setup_dynamic_gallery

The WooCommerce Dynamic Gallery LITE setup dynamic gallery function.

Description

setup_dynamic_gallery(); 

Usage

  1. if ( !function_exists( 'setup_dynamic_gallery' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-dynamic-gallery-lite/admin/wc_gallery_woocommerce_admin.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = setup_dynamic_gallery(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/admin/wc_gallery_woocommerce_admin.php  
  1. function setup_dynamic_gallery() { 
  2. global $post; 
  3. $current_db_version = get_option( 'woocommerce_db_version', null ); 
  4. $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min'; 
  5. if ( is_singular( array( 'product' ) ) || (! empty( $post->post_content ) && stristr($post->post_content, '[product_page') !== false ) ) { 
  6. $global_wc_dgallery_activate = get_option( WOO_DYNAMIC_GALLERY_PREFIX.'activate' ); 
  7. $actived_d_gallery = get_post_meta($post->ID, '_actived_d_gallery', true); 
  8.  
  9. if ($actived_d_gallery == '' && $global_wc_dgallery_activate != 'no') { 
  10. $actived_d_gallery = 1; 
  11.  
  12. if($actived_d_gallery == 1) { 
  13.  
  14. // Include google fonts into header 
  15. add_action( 'wp_enqueue_scripts', array( 'WC_Dynamic_Gallery_Functions', 'add_google_fonts'), 9 ); 
  16.  
  17. remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20); 
  18. remove_action( 'woocommerce_product_thumbnails', 'woocommerce_show_product_thumbnails', 20 ); 
  19.  
  20.  
  21. wp_enqueue_style( 'a3-dgallery-style' ); 
  22. wp_enqueue_script( 'a3-dgallery-script' ); 
  23.  
  24.  
  25. $popup_gallery = get_option( WOO_DYNAMIC_GALLERY_PREFIX.'popup_gallery' ); 
  26. if ($popup_gallery == 'fb') { 
  27. wp_enqueue_style( 'woocommerce_fancybox_styles' ); 
  28. wp_enqueue_script( 'fancybox' ); 
  29. } elseif ($popup_gallery == 'colorbox') { 
  30. wp_enqueue_style( 'a3_colorbox_style' ); 
  31. wp_enqueue_script( 'colorbox_script' ); 
  32.  
  33. if ( in_array( 'woocommerce-professor-cloud/woocommerce-professor-cloud.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) && get_option('woocommerce_cloud_enableCloud') == 'true' ) : 
  34. endif;