HT Mega – Addons for Elementor Page Builder ( Elementor Addons, Post Grid, Post Slider, Post Carousel, Mega Menu, Elementor Widgets, Elementor Templates, Accordion, Forms, Tables) - Version 1.5.6

Version Description

Download this release

Release Info

Developer devitemsllc
Plugin Icon 128x128 HT Mega – Addons for Elementor Page Builder ( Elementor Addons, Post Grid, Post Slider, Post Carousel, Mega Menu, Elementor Widgets, Elementor Templates, Accordion, Forms, Tables)
Version 1.5.6
Comparing to
See all releases

Code changes from version 1.5.4 to 1.5.6

assets/css/htmega-widgets.css CHANGED
@@ -6086,15 +6086,11 @@ a.instagram_follow_btn.possition-center span {
6086
  padding: 30px 0;
6087
  }
6088
 
6089
- .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span {
6090
  color: #fff;
6091
  margin: 0 15px;
6092
  }
6093
 
6094
- .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span i {
6095
- padding-right: 10px;
6096
- }
6097
-
6098
  .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-btn {
6099
  position: absolute;
6100
  top: 50%;
@@ -6253,14 +6249,10 @@ a.instagram_follow_btn.possition-center span {
6253
  padding: 0 !important;
6254
  }
6255
 
6256
- .htmega-instragram-style-3 ul li .instagram-clip .instagram-like-comment span {
6257
  margin: 0 15px;
6258
  }
6259
 
6260
- .htmega-instragram-style-3 ul li .instagram-clip .instagram-like-comment span i {
6261
- padding-right: 7px;
6262
- }
6263
-
6264
  .htmega-instragram-style-3 ul li:hover .instagram-clip {
6265
  -webkit-transform: translateX(0);
6266
  transform: translateX(0);
@@ -6272,6 +6264,20 @@ a.instagram_follow_btn.possition-center span {
6272
  transform: scale(1.15) translate3d(0, 0, 0);
6273
  }
6274
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6275
 
6276
  /* Instagram Style 04 */
6277
  .htmega-instragram-style-4 ul.htmega-instagram-list li {
6086
  padding: 30px 0;
6087
  }
6088
 
6089
+ .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment p {
6090
  color: #fff;
6091
  margin: 0 15px;
6092
  }
6093
 
 
 
 
 
6094
  .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-btn {
6095
  position: absolute;
6096
  top: 50%;
6249
  padding: 0 !important;
6250
  }
6251
 
6252
+ .htmega-instragram-style-3 ul li .instagram-clip .instagram-like-comment p {
6253
  margin: 0 15px;
6254
  }
6255
 
 
 
 
 
6256
  .htmega-instragram-style-3 ul li:hover .instagram-clip {
6257
  -webkit-transform: translateX(0);
6258
  transform: translateX(0);
6264
  transform: scale(1.15) translate3d(0, 0, 0);
6265
  }
6266
 
6267
+ .htmega-instragram-style-3 ul.htmega-instagram-list li .instagram-clip .htmega-content{
6268
+ display: flex;
6269
+ align-items: center;
6270
+ }
6271
+
6272
+ .htmega-instragram-style-3 ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-btn{
6273
+ position: static;
6274
+ transform: translateY(0);
6275
+ display: flex;
6276
+ }
6277
+ .htmega-instragram-style-3 ul.htmega-instagram-list li .instagram-clip .htmega-content .zoom_icon {
6278
+ display: flex;
6279
+ }
6280
+
6281
 
6282
  /* Instagram Style 04 */
6283
  .htmega-instragram-style-4 ul.htmega-instagram-list li {
assets/js/htmega-widgets-active.js CHANGED
@@ -704,6 +704,7 @@
704
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-newtsicker-addons.default', WidgetNewsTrickerHandler);
705
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-magnific-popup-addons.default', WidgetLightboxHandler);
706
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-videoplayer-addons.default', WidgetVideoPlayerHandler);
 
707
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-tooltip-addons.default', WidgetTooltipHandler);
708
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-popover-addons.default', WidgetPopoversHandler);
709
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-notify-addons.default', WidgetNotifyHandler);
704
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-newtsicker-addons.default', WidgetNewsTrickerHandler);
705
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-magnific-popup-addons.default', WidgetLightboxHandler);
706
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-videoplayer-addons.default', WidgetVideoPlayerHandler);
707
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-instagram-addons.default', WidgetHtmegaCarouselHandler);
708
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-tooltip-addons.default', WidgetTooltipHandler);
709
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-popover-addons.default', WidgetPopoversHandler);
710
  elementorFrontend.hooks.addAction( 'frontend/element_ready/htmega-notify-addons.default', WidgetNotifyHandler);
assets/js/jquery.instagramFeed.min.js DELETED
@@ -1 +0,0 @@
1
- ;(function(a){function b(a){return a.replace(/[&<>"'`=\/]/g,function(a){return e[a]})}var c={host:"https://www.instagram.com/",username:"",tag:"",container:"",display_profile:!0,display_biography:!0,display_gallery:!0,display_igtv:!1,callback:null,styling:!0,items:8,items_per_row:4,margin:.5,image_size:640,lazy_load:!1,on_error:console.error},d={150:0,240:1,320:2,480:3,640:4},e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};a.instagramFeed=function(e){var f=a.fn.extend({},c,e);if(""==f.username&&""==f.tag)return f.on_error("Instagram Feed: Error, no username nor tag defined.",1),!1;if("undefined"!=typeof f.get_data&&console.warn("Instagram Feed: options.get_data is deprecated, options.callback is always called if defined"),null==f.callback&&""==f.container)return f.on_error("Instagram Feed: Error, neither container found nor callback defined.",2),!1;var g=""==f.username,h=g?f.host+"explore/tags/"+f.tag+"/":f.host+f.username+"/";return a.get(h,function(c){try{c=c.split("window._sharedData = ")[1].split("</script>")[0]}catch(a){return void f.on_error("Instagram Feed: It looks like the profile you are trying to fetch is age restricted. See https://github.com/jsanahuja/InstagramFeed/issues/26",3)}if(c=JSON.parse(c.substr(0,c.length-1)),c=c.entry_data.ProfilePage||c.entry_data.TagPage,"undefined"==typeof c)return void f.on_error("Instagram Feed: It looks like YOUR network has been temporary banned because of too many requests. See https://github.com/jsanahuja/jquery.instagramFeed/issues/25",4);if(c=c[0].graphql.user||c[0].graphql.hashtag,""!=f.container){var e={profile_container:"",profile_image:"",profile_name:"",profile_biography:"",gallery_image:""};if(f.styling){e.profile_container=" style='text-align:center;'",e.profile_image=" style='border-radius:10em;width:15%;max-width:125px;min-width:50px;'",e.profile_name=" style='font-size:1.2em;'",e.profile_biography=" style='font-size:1em;'";var h=(100-2*f.margin*f.items_per_row)/f.items_per_row;e.gallery_image=" style='margin:"+f.margin+"% "+f.margin+"%;width:"+h+"%;float:left;'"}var j="";f.display_profile&&(j+="<div class='instagram_profile'"+e.profile_container+">",j+="<img class='instagram_profile_image' src='"+c.profile_pic_url+"' alt='"+(g?c.name+" tag pic":c.username+" profile pic")+"'"+e.profile_image+(f.lazy_load?" loading='lazy'":"")+" />",j+=g?"<p class='instagram_tag'"+e.profile_name+"><a href='https://www.instagram.com/explore/tags/"+f.tag+"' rel='noopener' target='_blank'>#"+f.tag+"</a></p>":"<p class='instagram_username'"+e.profile_name+">@"+c.full_name+" (<a href='https://www.instagram.com/"+f.username+"' rel='noopener' target='_blank'>@"+f.username+"</a>)</p>",!g&&f.display_biography&&(j+="<p class='instagram_biography'"+e.profile_biography+">"+c.biography+"</p>"),j+="</div>");var k="undefined"==typeof d[f.image_size]?d[640]:d[f.image_size];if(f.display_gallery)if("undefined"!=typeof c.is_private&&!0===c.is_private)j+="<p class='instagram_private'><strong>This profile is private</strong></p>";else{var l=(c.edge_owner_to_timeline_media||c.edge_hashtag_to_media).edges;s=l.length>f.items?f.items:l.length,j+="<div class='instagram_gallery'>";for(var m=0;m<s;m++){var n,o,p,q="https://www.instagram.com/p/"+l[m].node.shortcode;switch(l[m].node.__typename){case"GraphSidecar":o="sidecar",n=l[m].node.thumbnail_resources[k].src;break;case"GraphVideo":o="video",n=l[m].node.thumbnail_src;break;default:o="image",n=l[m].node.thumbnail_resources[k].src;}p="undefined"!=typeof l[m].node.edge_media_to_caption.edges[0]&&"undefined"!=typeof l[m].node.edge_media_to_caption.edges[0].node&&"undefined"!=typeof l[m].node.edge_media_to_caption.edges[0].node.text&&null!==l[m].node.edge_media_to_caption.edges[0].node.text?l[m].node.edge_media_to_caption.edges[0].node.text:"undefined"!=typeof l[m].node.accessibility_caption&&null!==l[m].node.accessibility_caption?l[m].node.accessibility_caption:(g?c.name:c.username)+" image "+m,j+="<a href='"+q+"' class='instagram-"+o+"' rel='noopener' target='_blank'>",j+="<img"+(f.lazy_load?" loading='lazy'":"")+" src='"+n+"' alt='"+b(p)+"'"+e.gallery_image+" />",j+="</a>"}j+="</div>"}if(f.display_igtv&&"undefined"!=typeof c.edge_felix_video_timeline){var r=c.edge_felix_video_timeline.edges,s=r.length>f.items?f.items:r.length;if(0<r.length){j+="<div class='instagram_igtv'>";for(var m=0;m<s;m++)j+="<a href='https://www.instagram.com/p/"+r[m].node.shortcode+"' rel='noopener' target='_blank'>",j+="<img"+(f.lazy_load?" loading='lazy'":"")+" src='"+r[m].node.thumbnail_src+"' alt='"+f.username+" instagram image "+m+"'"+e.gallery_image+" />",j+="</a>";j+="</div>"}}a(f.container).html(j)}null!=f.callback&&f.callback(c)}).fail(function(a){f.on_error("Instagram Feed: Unable to fetch the given user/tag. Instagram responded with the status code: "+a.status,5)}),!0}})(jQuery);
 
htmega_addons_elementor.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: http://demo.wphash.com/htmega/
6
  * Author: HasThemes
7
  * Author URI: https://hasthemes.com/
8
- * Version: 1.5.4
9
  * License: GPL2
10
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  * Text Domain: htmega-addons
@@ -13,7 +13,7 @@
13
  */
14
 
15
  if( ! defined( 'ABSPATH' ) ) exit(); // Exit if accessed directly
16
- define( 'HTMEGA_VERSION', '1.5.4' );
17
  define( 'HTMEGA_ADDONS_PL_ROOT', __FILE__ );
18
  define( 'HTMEGA_ADDONS_PL_URL', plugins_url( '/', HTMEGA_ADDONS_PL_ROOT ) );
19
  define( 'HTMEGA_ADDONS_PL_PATH', plugin_dir_path( HTMEGA_ADDONS_PL_ROOT ) );
5
  * Plugin URI: http://demo.wphash.com/htmega/
6
  * Author: HasThemes
7
  * Author URI: https://hasthemes.com/
8
+ * Version: 1.5.6
9
  * License: GPL2
10
  * License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
  * Text Domain: htmega-addons
13
  */
14
 
15
  if( ! defined( 'ABSPATH' ) ) exit(); // Exit if accessed directly
16
+ define( 'HTMEGA_VERSION', '1.5.6' );
17
  define( 'HTMEGA_ADDONS_PL_ROOT', __FILE__ );
18
  define( 'HTMEGA_ADDONS_PL_URL', plugins_url( '/', HTMEGA_ADDONS_PL_ROOT ) );
19
  define( 'HTMEGA_ADDONS_PL_PATH', plugin_dir_path( HTMEGA_ADDONS_PL_ROOT ) );
includes/class.assests.php CHANGED
@@ -255,11 +255,6 @@ if ( !class_exists( 'HTMega_Elementor_Addons_Assests' ) ) {
255
  'version' => HTMEGA_VERSION,
256
  'deps' => [ 'jquery' ]
257
  ],
258
- 'htmegainstagramfeed' => [
259
- 'src' => HTMEGA_ADDONS_PL_URL . 'assets/js/jquery.instagramFeed.min.js',
260
- 'version' => HTMEGA_VERSION,
261
- 'deps' => [ 'jquery' ]
262
- ],
263
  'google-map-api' => [
264
  'src' => 'http://maps.googleapis.com/maps/api/js?sensor=false',
265
  'version' => HTMEGA_VERSION,
255
  'version' => HTMEGA_VERSION,
256
  'deps' => [ 'jquery' ]
257
  ],
 
 
 
 
 
258
  'google-map-api' => [
259
  'src' => 'http://maps.googleapis.com/maps/api/js?sensor=false',
260
  'version' => HTMEGA_VERSION,
includes/class.htmega.php CHANGED
@@ -35,7 +35,7 @@ final class HTMega_Addons_Elementor {
35
  if ( ! function_exists('is_plugin_active') ){ include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); }
36
 
37
  add_action( 'init', [ $this, 'i18n' ] );
38
- add_action( 'plugins_loaded', [ $this, 'init' ] );
39
 
40
  // Register Plugin Active Hook
41
  register_activation_hook( HTMEGA_ADDONS_PL_ROOT, [ $this, 'plugin_activate_hook'] );
35
  if ( ! function_exists('is_plugin_active') ){ include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); }
36
 
37
  add_action( 'init', [ $this, 'i18n' ] );
38
+ add_action( 'plugins_loaded', [ $this, 'init' ], 15 );
39
 
40
  // Register Plugin Active Hook
41
  register_activation_hook( HTMEGA_ADDONS_PL_ROOT, [ $this, 'plugin_activate_hook'] );
includes/widgets/htmega_instagram - Copy.php ADDED
@@ -0,0 +1,1672 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace Elementor;
3
+
4
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
5
+
6
+ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
7
+
8
+ public function get_name() {
9
+ return 'htmega-instagram-addons';
10
+ }
11
+
12
+ public function get_title() {
13
+ return __( 'Instagram', 'htmega-addons' );
14
+ }
15
+
16
+ public function get_icon() {
17
+ return 'htmega-icon eicon-photo-library';
18
+ }
19
+
20
+ public function get_categories() {
21
+ return [ 'htmega-addons' ];
22
+ }
23
+
24
+ public function get_style_depends() {
25
+ return [
26
+ 'elementor-icons-shared-0-css','elementor-icons-fa-brands','elementor-icons-fa-regular','elementor-icons-fa-solid',
27
+ 'slick',
28
+ ];
29
+ }
30
+
31
+ public function get_script_depends() {
32
+ return [
33
+ 'htmegainstagramfeed',
34
+ 'slick',
35
+ 'htmega-widgets-scripts',
36
+ ];
37
+ }
38
+
39
+ protected function _register_controls() {
40
+
41
+ $this->start_controls_section(
42
+ 'instagram_content',
43
+ [
44
+ 'label' => __( 'Instagram', 'htmega-addons' ),
45
+ ]
46
+ );
47
+
48
+ $this->add_control(
49
+ 'instagram_style',
50
+ [
51
+ 'label' => __( 'Style', 'htmega-addons' ),
52
+ 'type' => Controls_Manager::SELECT,
53
+ 'default' => '1',
54
+ 'options' => [
55
+ '1' => __( 'Style One', 'htmega-addons' ),
56
+ '2' => __( 'Style Two', 'htmega-addons' ),
57
+ '3' => __( 'Style Three', 'htmega-addons' ),
58
+ '4' => __( 'Style Four', 'htmega-addons' ),
59
+ ],
60
+ 'label_block' => true,
61
+ ]
62
+ );
63
+
64
+ $this->add_control(
65
+ 'username',
66
+ [
67
+ 'label' => __( 'Instagram UserName', 'htmega-addons' ),
68
+ 'type' => Controls_Manager::TEXT,
69
+ 'placeholder' => __( 'portfolio.devitems', 'htmega-addons' ),
70
+ 'label_block' =>true,
71
+ ]
72
+ );
73
+
74
+ $this->add_control(
75
+ 'limit',
76
+ [
77
+ 'label' => __( 'Item Limit', 'htmega-addons' ),
78
+ 'type' => Controls_Manager::NUMBER,
79
+ 'min' => 1,
80
+ 'max' => 200,
81
+ 'step' => 1,
82
+ 'default' => 8,
83
+ 'separator'=>'before',
84
+ ]
85
+ );
86
+
87
+ $this->add_responsive_control(
88
+ 'instagram_column',
89
+ [
90
+ 'label' => __( 'Column', 'htmega-addons' ),
91
+ 'type' => Controls_Manager::SELECT,
92
+ 'description' => wp_kses_post( 'If the slider is off, Then it will work.', 'htmega-addons' ),
93
+ 'prefix_class' => 'htmegainstagram-column%s-',
94
+ 'default' => '4',
95
+ 'required' => true,
96
+ 'device_args' => [
97
+ Controls_Stack::RESPONSIVE_TABLET => [
98
+ 'required' => false,
99
+ ],
100
+ Controls_Stack::RESPONSIVE_MOBILE => [
101
+ 'required' => false,
102
+ ],
103
+ ],
104
+ 'min_affected_device' => [
105
+ Controls_Stack::RESPONSIVE_DESKTOP => Controls_Stack::RESPONSIVE_TABLET,
106
+ Controls_Stack::RESPONSIVE_TABLET => Controls_Stack::RESPONSIVE_TABLET,
107
+ ],
108
+ 'options' => [
109
+ '1' => __( '1', 'htmega-addons' ),
110
+ '2' => __( '2', 'htmega-addons' ),
111
+ '3' => __( '3', 'htmega-addons' ),
112
+ '4' => __( '4', 'htmega-addons' ),
113
+ '5' => __( '5', 'htmega-addons' ),
114
+ '6' => __( '6', 'htmega-addons' ),
115
+ ],
116
+ ]
117
+ );
118
+
119
+ $this->add_control(
120
+ 'instagram_image_size',
121
+ [
122
+ 'label' => __( 'Image Size', 'htmega-addons' ),
123
+ 'type' => Controls_Manager::SELECT,
124
+ 'default' => '480',
125
+ 'options' => [
126
+ '150' => __( '150', 'htmega-addons' ),
127
+ '240' => __( '240', 'htmega-addons' ),
128
+ '320' => __( '320', 'htmega-addons' ),
129
+ '480' => __( '480', 'htmega-addons' ),
130
+ '640' => __( '640', 'htmega-addons' ),
131
+ ],
132
+ ]
133
+ );
134
+
135
+ $this->add_control(
136
+ 'clear_cache_data',
137
+ [
138
+ 'label' => esc_html__( 'Clear Cache Data', 'htmega-addons' ),
139
+ 'type' => Controls_Manager::SWITCHER,
140
+ 'label_on' => esc_html__( 'Yes', 'htmega-addons' ),
141
+ 'label_off' => esc_html__( 'No', 'htmega-addons' ),
142
+ 'return_value' => 'yes',
143
+ 'default' => 'no',
144
+ ]
145
+ );
146
+
147
+ $this->add_control(
148
+ 'lazy_load',
149
+ [
150
+ 'label' => __( 'Lazy Load', 'htmega-addons' ),
151
+ 'type' => Controls_Manager::SWITCHER,
152
+ 'label_on' => __( 'Show', 'htmega-addons' ),
153
+ 'label_off' => __( 'Hide', 'htmega-addons' ),
154
+ 'return_value' => 'yes',
155
+ 'default' => 'no',
156
+ ]
157
+ );
158
+
159
+ $this->add_control(
160
+ 'show_like',
161
+ [
162
+ 'label' => __( 'Show Like', 'htmega-addons' ),
163
+ 'type' => Controls_Manager::SWITCHER,
164
+ 'label_on' => __( 'Show', 'htmega-addons' ),
165
+ 'label_off' => __( 'Hide', 'htmega-addons' ),
166
+ 'return_value' => 'yes',
167
+ 'default' => 'yes',
168
+ ]
169
+ );
170
+
171
+ $this->add_control(
172
+ 'show_comment',
173
+ [
174
+ 'label' => __( 'Show Comment', 'htmega-addons' ),
175
+ 'type' => Controls_Manager::SWITCHER,
176
+ 'label_on' => __( 'Show', 'htmega-addons' ),
177
+ 'label_off' => __( 'Hide', 'htmega-addons' ),
178
+ 'return_value' => 'yes',
179
+ 'default' => 'yes',
180
+ ]
181
+ );
182
+
183
+ $this->add_control(
184
+ 'show_light_box',
185
+ [
186
+ 'label' => __( 'Show Light Box', 'htmega-addons' ),
187
+ 'type' => Controls_Manager::SWITCHER,
188
+ 'label_on' => __( 'Show', 'htmega-addons' ),
189
+ 'label_off' => __( 'Hide', 'htmega-addons' ),
190
+ 'return_value' => 'yes',
191
+ 'default' => 'yes',
192
+ ]
193
+ );
194
+
195
+ $this->add_control(
196
+ 'show_flow_button',
197
+ [
198
+ 'label' => __( 'Show Follow Button', 'htmega-addons' ),
199
+ 'type' => Controls_Manager::SWITCHER,
200
+ 'label_on' => __( 'Show', 'htmega-addons' ),
201
+ 'label_off' => __( 'Hide', 'htmega-addons' ),
202
+ 'return_value' => 'yes',
203
+ 'default' => 'yes',
204
+ ]
205
+ );
206
+
207
+ $this->add_control(
208
+ 'slider_on',
209
+ [
210
+ 'label' => __( 'Slider', 'htmega-addons' ),
211
+ 'type' => Controls_Manager::SWITCHER,
212
+ 'label_on' => __( 'On', 'htmega-addons' ),
213
+ 'label_off' => __( 'Off', 'htmega-addons' ),
214
+ 'return_value' => 'yes',
215
+ 'default' => 'no',
216
+ ]
217
+ );
218
+
219
+ $this->add_control(
220
+ 'zoomicon_type',
221
+ [
222
+ 'label' => esc_html__('Zoom Icon Type','htmega-addons'),
223
+ 'type' =>Controls_Manager::CHOOSE,
224
+ 'options' =>[
225
+ 'img' =>[
226
+ 'title' =>__('Image','htmega-addons'),
227
+ 'icon' =>'fa fa-picture-o',
228
+ ],
229
+ 'icon' =>[
230
+ 'title' =>__('Icon','htmega-addons'),
231
+ 'icon' =>'fa fa-info',
232
+ ]
233
+ ],
234
+ 'default' =>'icon',
235
+ 'condition' =>[
236
+ 'show_light_box' =>'yes',
237
+ ],
238
+ ]
239
+ );
240
+
241
+ $this->add_control(
242
+ 'zoom_image',
243
+ [
244
+ 'label' => __('Zoom Image Icon','htmega-addons'),
245
+ 'type'=>Controls_Manager::MEDIA,
246
+ 'dynamic' => [
247
+ 'active' => true,
248
+ ],
249
+ 'condition' => [
250
+ 'show_light_box' =>'yes',
251
+ 'zoomicon_type' => 'img',
252
+ ]
253
+ ]
254
+ );
255
+
256
+ $this->add_group_control(
257
+ Group_Control_Image_Size::get_type(),
258
+ [
259
+ 'name' => 'zoom_imagesize',
260
+ 'default' => 'large',
261
+ 'separator' => 'none',
262
+ 'condition' => [
263
+ 'show_light_box' =>'yes',
264
+ 'zoomicon_type' => 'img',
265
+ ],
266
+ 'fields_options'=>[
267
+ 'size'=>[
268
+ 'label' => __('Zoom Icon Size','htmega-addons')
269
+ ]
270
+ ]
271
+ ]
272
+ );
273
+
274
+ $this->add_control(
275
+ 'zoom_icon',
276
+ [
277
+ 'label' =>__('Zoom Icon','htmega-addons'),
278
+ 'type'=>Controls_Manager::ICONS,
279
+ 'default' => [
280
+ 'value'=>'fas fa-plus',
281
+ 'library' => 'solid',
282
+ ],
283
+ 'condition' => [
284
+ 'show_light_box' =>'yes',
285
+ 'zoomicon_type' => 'icon',
286
+ ]
287
+ ]
288
+ );
289
+
290
+ $this->add_control(
291
+ 'comment_icon',
292
+ [
293
+ 'label' =>__('Comment Icon','htmega-addons'),
294
+ 'type'=>Controls_Manager::ICONS,
295
+ 'default' => [
296
+ 'value'=>'far fa-comment',
297
+ 'library' => 'solid',
298
+ ],
299
+ 'condition' => [
300
+ 'show_comment' =>'yes',
301
+ ]
302
+ ]
303
+ );
304
+
305
+ $this->add_control(
306
+ 'like_icon',
307
+ [
308
+ 'label' =>__('Like Icon','htmega-addons'),
309
+ 'type'=>Controls_Manager::ICONS,
310
+ 'default' => [
311
+ 'value'=>'far fa-heart',
312
+ 'library' => 'solid',
313
+ ],
314
+ 'condition' => [
315
+ 'show_like' =>'yes',
316
+ ]
317
+ ]
318
+ );
319
+
320
+ $this->add_control(
321
+ 'flow_button_icon',
322
+ [
323
+ 'label' =>__('Flow Button Icon','htmega-addons'),
324
+ 'type'=>Controls_Manager::ICONS,
325
+ 'default' => [
326
+ 'value'=>'fab fa-instagram',
327
+ 'library' => 'solid',
328
+ ],
329
+ 'condition' => [
330
+ 'show_flow_button' =>'yes',
331
+ ]
332
+ ]
333
+ );
334
+
335
+ $this->add_control(
336
+ 'flow_button_txt',
337
+ [
338
+ 'label' => __( 'Flow Button Prefix', 'htmega-addons' ),
339
+ 'type' => Controls_Manager::TEXT,
340
+ 'default' => __( 'Follow @', 'htmega-addons' ),
341
+ ]
342
+ );
343
+
344
+ $this->end_controls_section();
345
+
346
+ // Slider setting
347
+ $this->start_controls_section(
348
+ 'instagram_slider_option',
349
+ [
350
+ 'label' => esc_html__( 'Slider Option', 'htmega-addons' ),
351
+ 'condition' => [
352
+ 'slider_on' => 'yes',
353
+ ]
354
+ ]
355
+ );
356
+
357
+ $this->add_control(
358
+ 'slitems',
359
+ [
360
+ 'label' => esc_html__( 'Slider Items', 'htmega-addons' ),
361
+ 'type' => Controls_Manager::NUMBER,
362
+ 'min' => 1,
363
+ 'max' => 20,
364
+ 'step' => 1,
365
+ 'default' => 8,
366
+ 'condition' => [
367
+ 'slider_on' => 'yes',
368
+ ]
369
+ ]
370
+ );
371
+
372
+ $this->add_control(
373
+ 'slarrows',
374
+ [
375
+ 'label' => esc_html__( 'Slider Arrow', 'htmega-addons' ),
376
+ 'type' => Controls_Manager::SWITCHER,
377
+ 'return_value' => 'yes',
378
+ 'default' => 'yes',
379
+ 'condition' => [
380
+ 'slider_on' => 'yes',
381
+ ]
382
+ ]
383
+ );
384
+
385
+ $this->add_control(
386
+ 'slprevicon',
387
+ [
388
+ 'label' => __( 'Previous icon', 'htmega-addons' ),
389
+ 'type' => Controls_Manager::ICONS,
390
+ 'default' => [
391
+ 'value'=>'fas fa-angle-left',
392
+ 'library' => 'solid',
393
+ ],
394
+ 'condition' => [
395
+ 'slider_on' => 'yes',
396
+ 'slarrows' => 'yes',
397
+ ]
398
+ ]
399
+ );
400
+
401
+ $this->add_control(
402
+ 'slnexticon',
403
+ [
404
+ 'label' => __( 'Next icon', 'htmega-addons' ),
405
+ 'type' => Controls_Manager::ICONS,
406
+ 'default' => [
407
+ 'value'=>'fas fa-angle-right',
408
+ 'library' => 'solid',
409
+ ],
410
+ 'condition' => [
411
+ 'slider_on' => 'yes',
412
+ 'slarrows' => 'yes',
413
+ ]
414
+ ]
415
+ );
416
+
417
+ $this->add_control(
418
+ 'sldots',
419
+ [
420
+ 'label' => esc_html__( 'Slider dots', 'htmega-addons' ),
421
+ 'type' => Controls_Manager::SWITCHER,
422
+ 'return_value' => 'yes',
423
+ 'default' => 'no',
424
+ 'condition' => [
425
+ 'slider_on' => 'yes',
426
+ ]
427
+ ]
428
+ );
429
+
430
+ $this->add_control(
431
+ 'slpause_on_hover',
432
+ [
433
+ 'type' => Controls_Manager::SWITCHER,
434
+ 'label_off' => __('No', 'htmega-addons'),
435
+ 'label_on' => __('Yes', 'htmega-addons'),
436
+ 'return_value' => 'yes',
437
+ 'default' => 'yes',
438
+ 'label' => __('Pause on Hover?', 'htmega-addons'),
439
+ 'condition' => [
440
+ 'slider_on' => 'yes',
441
+ ]
442
+ ]
443
+ );
444
+
445
+ $this->add_control(
446
+ 'slcentermode',
447
+ [
448
+ 'label' => esc_html__( 'Center Mode', 'htmega-addons' ),
449
+ 'type' => Controls_Manager::SWITCHER,
450
+ 'return_value' => 'yes',
451
+ 'default' => 'no',
452
+ 'condition' => [
453
+ 'slider_on' => 'yes',
454
+ ]
455
+ ]
456
+ );
457
+
458
+ $this->add_control(
459
+ 'slcenterpadding',
460
+ [
461
+ 'label' => esc_html__( 'Center padding', 'htmega-addons' ),
462
+ 'type' => Controls_Manager::NUMBER,
463
+ 'min' => 0,
464
+ 'max' => 500,
465
+ 'step' => 1,
466
+ 'default' => 50,
467
+ 'condition' => [
468
+ 'slider_on' => 'yes',
469
+ 'slcentermode' => 'yes',
470
+ ]
471
+ ]
472
+ );
473
+
474
+ $this->add_control(
475
+ 'slautolay',
476
+ [
477
+ 'label' => esc_html__( 'Slider auto play', 'htmega-addons' ),
478
+ 'type' => Controls_Manager::SWITCHER,
479
+ 'return_value' => 'yes',
480
+ 'separator' => 'before',
481
+ 'default' => 'no',
482
+ 'condition' => [
483
+ 'slider_on' => 'yes',
484
+ ]
485
+ ]
486
+ );
487
+
488
+ $this->add_control(
489
+ 'slautoplay_speed',
490
+ [
491
+ 'label' => __('Autoplay speed', 'htmega-addons'),
492
+ 'type' => Controls_Manager::NUMBER,
493
+ 'default' => 3000,
494
+ 'condition' => [
495
+ 'slider_on' => 'yes',
496
+ ]
497
+ ]
498
+ );
499
+
500
+ $this->add_control(
501
+ 'slanimation_speed',
502
+ [
503
+ 'label' => __('Autoplay animation speed', 'htmega-addons'),
504
+ 'type' => Controls_Manager::NUMBER,
505
+ 'default' => 300,
506
+ 'condition' => [
507
+ 'slider_on' => 'yes',
508
+ ]
509
+ ]
510
+ );
511
+
512
+ $this->add_control(
513
+ 'slscroll_columns',
514
+ [
515
+ 'label' => __('Slider item to scroll', 'htmega-addons'),
516
+ 'type' => Controls_Manager::NUMBER,
517
+ 'min' => 1,
518
+ 'max' => 10,
519
+ 'step' => 1,
520
+ 'default' => 1,
521
+ 'condition' => [
522
+ 'slider_on' => 'yes',
523
+ ]
524
+ ]
525
+ );
526
+
527
+ $this->add_control(
528
+ 'heading_tablet',
529
+ [
530
+ 'label' => __( 'Tablet', 'htmega-addons' ),
531
+ 'type' => Controls_Manager::HEADING,
532
+ 'separator' => 'after',
533
+ 'condition' => [
534
+ 'slider_on' => 'yes',
535
+ ]
536
+ ]
537
+ );
538
+
539
+ $this->add_control(
540
+ 'sltablet_display_columns',
541
+ [
542
+ 'label' => __('Slider Items', 'htmega-addons'),
543
+ 'type' => Controls_Manager::NUMBER,
544
+ 'min' => 1,
545
+ 'max' => 8,
546
+ 'step' => 1,
547
+ 'default' => 1,
548
+ 'condition' => [
549
+ 'slider_on' => 'yes',
550
+ ]
551
+ ]
552
+ );
553
+
554
+ $this->add_control(
555
+ 'sltablet_scroll_columns',
556
+ [
557
+ 'label' => __('Slider item to scroll', 'htmega-addons'),
558
+ 'type' => Controls_Manager::NUMBER,
559
+ 'min' => 1,
560
+ 'max' => 8,
561
+ 'step' => 1,
562
+ 'default' => 1,
563
+ 'condition' => [
564
+ 'slider_on' => 'yes',
565
+ ]
566
+ ]
567
+ );
568
+
569
+ $this->add_control(
570
+ 'sltablet_width',
571
+ [
572
+ 'label' => __('Tablet Resolution', 'htmega-addons'),
573
+ 'description' => __('The resolution to tablet.', 'htmega-addons'),
574
+ 'type' => Controls_Manager::NUMBER,
575
+ 'default' => 750,
576
+ 'condition' => [
577
+ 'slider_on' => 'yes',
578
+ ]
579
+ ]
580
+ );
581
+
582
+ $this->add_control(
583
+ 'heading_mobile',
584
+ [
585
+ 'label' => __( 'Mobile Phone', 'htmega-addons' ),
586
+ 'type' => Controls_Manager::HEADING,
587
+ 'separator' => 'after',
588
+ 'condition' => [
589
+ 'slider_on' => 'yes',
590
+ ]
591
+ ]
592
+ );
593
+
594
+ $this->add_control(
595
+ 'slmobile_display_columns',
596
+ [
597
+ 'label' => __('Slider Items', 'htmega-addons'),
598
+ 'type' => Controls_Manager::NUMBER,
599
+ 'min' => 1,
600
+ 'max' => 4,
601
+ 'step' => 1,
602
+ 'default' => 1,
603
+ 'condition' => [
604
+ 'slider_on' => 'yes',
605
+ ]
606
+ ]
607
+ );
608
+
609
+ $this->add_control(
610
+ 'slmobile_scroll_columns',
611
+ [
612
+ 'label' => __('Slider item to scroll', 'htmega-addons'),
613
+ 'type' => Controls_Manager::NUMBER,
614
+ 'min' => 1,
615
+ 'max' => 4,
616
+ 'step' => 1,
617
+ 'default' => 1,
618
+ 'condition' => [
619
+ 'slider_on' => 'yes',
620
+ ]
621
+ ]
622
+ );
623
+
624
+ $this->add_control(
625
+ 'slmobile_width',
626
+ [
627
+ 'label' => __('Mobile Resolution', 'htmega-addons'),
628
+ 'description' => __('The resolution to mobile.', 'htmega-addons'),
629
+ 'type' => Controls_Manager::NUMBER,
630
+ 'default' => 480,
631
+ 'condition' => [
632
+ 'slider_on' => 'yes',
633
+ ]
634
+ ]
635
+ );
636
+
637
+ $this->end_controls_section(); // Slider Option end
638
+
639
+ // Style tab section
640
+ $this->start_controls_section(
641
+ 'htmega_instagram_style_section',
642
+ [
643
+ 'label' => __( 'Style', 'htmega-addons' ),
644
+ 'tab' => Controls_Manager::TAB_STYLE,
645
+ ]
646
+ );
647
+
648
+ $this->add_group_control(
649
+ Group_Control_Background::get_type(),
650
+ [
651
+ 'name' => 'instagram_background',
652
+ 'label' => __( 'Background', 'htmega-addons' ),
653
+ 'types' => [ 'classic', 'gradient' ],
654
+ 'selector' => '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list',
655
+ ]
656
+ );
657
+
658
+ $this->add_responsive_control(
659
+ 'instagram_margin',
660
+ [
661
+ 'label' => __( 'Margin', 'htmega-addons' ),
662
+ 'type' => Controls_Manager::DIMENSIONS,
663
+ 'size_units' => [ 'px', '%', 'em' ],
664
+ 'selectors' => [
665
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
666
+ ],
667
+ 'separator' =>'before',
668
+ ]
669
+ );
670
+
671
+ $this->add_responsive_control(
672
+ 'instagram_padding',
673
+ [
674
+ 'label' => __( 'Padding', 'htmega-addons' ),
675
+ 'type' => Controls_Manager::DIMENSIONS,
676
+ 'size_units' => [ 'px', '%', 'em' ],
677
+ 'selectors' => [
678
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
679
+ ],
680
+ ]
681
+ );
682
+
683
+ $this->end_controls_section(); // Style Section
684
+
685
+ // Item Style
686
+ $this->start_controls_section(
687
+ 'htmega_instagram_item_style_section',
688
+ [
689
+ 'label' => __( 'Item', 'htmega-addons' ),
690
+ 'tab' => Controls_Manager::TAB_STYLE,
691
+ ]
692
+ );
693
+
694
+ $this->add_group_control(
695
+ Group_Control_Background::get_type(),
696
+ [
697
+ 'name' => 'instagram_item_background',
698
+ 'label' => __( 'Background', 'htmega-addons' ),
699
+ 'types' => [ 'classic', 'gradient' ],
700
+ 'selector' => '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li',
701
+ ]
702
+ );
703
+
704
+ $this->add_responsive_control(
705
+ 'instagram_item_margin',
706
+ [
707
+ 'label' => __( 'Margin', 'htmega-addons' ),
708
+ 'type' => Controls_Manager::DIMENSIONS,
709
+ 'size_units' => [ 'px', '%', 'em' ],
710
+ 'selectors' => [
711
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
712
+ ],
713
+ 'separator' =>'before',
714
+ ]
715
+ );
716
+
717
+ $this->add_responsive_control(
718
+ 'instagram_item_padding',
719
+ [
720
+ 'label' => __( 'Padding', 'htmega-addons' ),
721
+ 'type' => Controls_Manager::DIMENSIONS,
722
+ 'size_units' => [ 'px', '%', 'em' ],
723
+ 'selectors' => [
724
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
725
+ ],
726
+ ]
727
+ );
728
+
729
+ $this->add_group_control(
730
+ Group_Control_Border::get_type(),
731
+ [
732
+ 'name' => 'instagram_item_border',
733
+ 'label' => __( 'Border', 'htmega-addons' ),
734
+ 'selector' => '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li',
735
+ ]
736
+ );
737
+
738
+ $this->add_responsive_control(
739
+ 'instagram_item_border_radius',
740
+ [
741
+ 'label' => esc_html__( 'Border Radius', 'htmega-addons' ),
742
+ 'type' => Controls_Manager::DIMENSIONS,
743
+ 'selectors' => [
744
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
745
+ ],
746
+ ]
747
+ );
748
+
749
+ $this->add_control(
750
+ 'instagram_item_overlay_color',
751
+ [
752
+ 'label' => __( 'Overlay Color', 'htmega-addons' ),
753
+ 'type' => Controls_Manager::COLOR,
754
+ 'default' => 'rgba(0, 0, 0, 0.7)',
755
+ 'selectors' => [
756
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip::before' => 'background-color: {{VALUE}};',
757
+ ],
758
+ ]
759
+ );
760
+
761
+ $this->end_controls_section(); // Item Style end
762
+
763
+ // Zoom icon Style
764
+ $this->start_controls_section(
765
+ 'htmega_instagram_icon_style_section',
766
+ [
767
+ 'label' => __( 'Zoom Icon', 'htmega-addons' ),
768
+ 'tab' => Controls_Manager::TAB_STYLE,
769
+ 'condition' =>[
770
+ 'zoomicon_type'=>'icon',
771
+ 'zoom_icon[value]!'=>'',
772
+ ]
773
+ ]
774
+ );
775
+
776
+ $this->add_control(
777
+ 'icon_size',
778
+ [
779
+ 'label' => __( 'Font Size', 'htmega-addons' ),
780
+ 'type' => Controls_Manager::SLIDER,
781
+ 'size_units' => [ 'px', '%' ],
782
+ 'range' => [
783
+ 'px' => [
784
+ 'min' => 0,
785
+ 'max' => 100,
786
+ 'step' => 1,
787
+ ],
788
+ '%' => [
789
+ 'min' => 0,
790
+ 'max' => 100,
791
+ ],
792
+ ],
793
+ 'default' => [
794
+ 'unit' => 'px',
795
+ 'size' => 43,
796
+ ],
797
+ 'selectors' => [
798
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon i' => 'font-size: {{SIZE}}{{UNIT}};',
799
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon svg' => 'font-size: {{SIZE}}{{UNIT}};',
800
+ ],
801
+ ]
802
+ );
803
+
804
+ $this->add_control(
805
+ 'instagram_icon_color',
806
+ [
807
+ 'label' => __( 'Color', 'htmega-addons' ),
808
+ 'type' => Controls_Manager::COLOR,
809
+ 'default' => '#ffffff',
810
+ 'selectors' => [
811
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon i' => 'color: {{VALUE}};',
812
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon svg' => 'color: {{VALUE}};',
813
+ ],
814
+ ]
815
+ );
816
+
817
+ $this->add_group_control(
818
+ Group_Control_Background::get_type(),
819
+ [
820
+ 'name' => 'instagram_icon_background',
821
+ 'label' => __( 'Background', 'htmega-addons' ),
822
+ 'types' => [ 'classic', 'gradient' ],
823
+ 'selector' => '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon',
824
+ ]
825
+ );
826
+
827
+ $this->add_responsive_control(
828
+ 'instagram_icon_padding',
829
+ [
830
+ 'label' => __( 'Padding', 'htmega-addons' ),
831
+ 'type' => Controls_Manager::DIMENSIONS,
832
+ 'size_units' => [ 'px', '%', 'em' ],
833
+ 'selectors' => [
834
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
835
+ ],
836
+ ]
837
+ );
838
+
839
+ $this->add_group_control(
840
+ Group_Control_Border::get_type(),
841
+ [
842
+ 'name' => 'instagram_icon_border',
843
+ 'label' => __( 'Border', 'htmega-addons' ),
844
+ 'selector' => '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon',
845
+ ]
846
+ );
847
+
848
+ $this->add_responsive_control(
849
+ 'instagram_icon_border_radius',
850
+ [
851
+ 'label' => esc_html__( 'Border Radius', 'htmega-addons' ),
852
+ 'type' => Controls_Manager::DIMENSIONS,
853
+ 'selectors' => [
854
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
855
+ ],
856
+ ]
857
+ );
858
+
859
+ $this->end_controls_section(); // Zoom icon Style end
860
+
861
+ // Zoom icon Style
862
+ $this->start_controls_section(
863
+ 'htmega_instagram_commentlike_style_section',
864
+ [
865
+ 'label' => __( 'Comment & Like', 'htmega-addons' ),
866
+ 'tab' => Controls_Manager::TAB_STYLE,
867
+ ]
868
+ );
869
+
870
+ $this->add_control(
871
+ 'commentlike_size',
872
+ [
873
+ 'label' => __( 'Font Size', 'htmega-addons' ),
874
+ 'type' => Controls_Manager::SLIDER,
875
+ 'size_units' => [ 'px', '%' ],
876
+ 'range' => [
877
+ 'px' => [
878
+ 'min' => 0,
879
+ 'max' => 100,
880
+ 'step' => 1,
881
+ ],
882
+ '%' => [
883
+ 'min' => 0,
884
+ 'max' => 100,
885
+ ],
886
+ ],
887
+ 'default' => [
888
+ 'unit' => 'px',
889
+ 'size' => 16,
890
+ ],
891
+ 'selectors' => [
892
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'font-size: {{SIZE}}{{UNIT}};',
893
+ ],
894
+ ]
895
+ );
896
+
897
+ $this->add_control(
898
+ 'instagram_commentlike_color',
899
+ [
900
+ 'label' => __( 'Color', 'htmega-addons' ),
901
+ 'type' => Controls_Manager::COLOR,
902
+ 'default' => '#ffffff',
903
+ 'selectors' => [
904
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'color: {{VALUE}};',
905
+ ],
906
+ ]
907
+ );
908
+
909
+ $this->add_responsive_control(
910
+ 'instagram_commentlike_padding',
911
+ [
912
+ 'label' => __( 'Padding', 'htmega-addons' ),
913
+ 'type' => Controls_Manager::DIMENSIONS,
914
+ 'size_units' => [ 'px', '%', 'em' ],
915
+ 'selectors' => [
916
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
917
+ ],
918
+ ]
919
+ );
920
+
921
+ $this->add_responsive_control(
922
+ 'instagram_commentlike_margin',
923
+ [
924
+ 'label' => __( 'Margin', 'htmega-addons' ),
925
+ 'type' => Controls_Manager::DIMENSIONS,
926
+ 'size_units' => [ 'px', '%', 'em' ],
927
+ 'selectors' => [
928
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
929
+ ],
930
+ ]
931
+ );
932
+
933
+ $this->add_group_control(
934
+ Group_Control_Border::get_type(),
935
+ [
936
+ 'name' => 'instagram_commentlike_border',
937
+ 'label' => __( 'Border', 'htmega-addons' ),
938
+ 'selector' => '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span',
939
+ ]
940
+ );
941
+
942
+ $this->add_responsive_control(
943
+ 'instagram_commentlike_border_radius',
944
+ [
945
+ 'label' => esc_html__( 'Border Radius', 'htmega-addons' ),
946
+ 'type' => Controls_Manager::DIMENSIONS,
947
+ 'selectors' => [
948
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
949
+ ],
950
+ ]
951
+ );
952
+
953
+ $this->end_controls_section(); // Zoom icon Style end
954
+
955
+ // Style Follow Button style start
956
+ $this->start_controls_section(
957
+ 'htmega_instagram_follow_btn_style',
958
+ [
959
+ 'label' => __( 'Follow Button', 'htmega-addons' ),
960
+ 'tab' => Controls_Manager::TAB_STYLE,
961
+ 'condition' =>[
962
+ 'show_flow_button' => 'yes',
963
+ ],
964
+ ]
965
+ );
966
+
967
+ $this->add_control(
968
+ 'follow_btn_margin',
969
+ [
970
+ 'label' => __( 'Margin', 'htmega-addons' ),
971
+ 'type' => Controls_Manager::DIMENSIONS,
972
+ 'size_units' => [ 'px', '%', 'em' ],
973
+ 'selectors' => [
974
+ '{{WRAPPER}} a.instagram_follow_btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
975
+ ],
976
+ ]
977
+ );
978
+
979
+ $this->add_control(
980
+ 'follow_btn_color',
981
+ [
982
+ 'label' => __( 'Color', 'htmega-addons' ),
983
+ 'type' => Controls_Manager::COLOR,
984
+ 'selectors' => [
985
+ '{{WRAPPER}} a.instagram_follow_btn' => 'color: {{VALUE}}',
986
+ ],
987
+ ]
988
+ );
989
+
990
+ $this->add_control(
991
+ 'follow_btn_bg_color',
992
+ [
993
+ 'label' => __( 'Background Color', 'htmega-addons' ),
994
+ 'type' => Controls_Manager::COLOR,
995
+ 'selectors' => [
996
+ '{{WRAPPER}} a.instagram_follow_btn' => 'background-color: {{VALUE}}',
997
+ ],
998
+ ]
999
+ );
1000
+
1001
+ $this->add_control(
1002
+ 'follow_btn_icon_bg_color',
1003
+ [
1004
+ 'label' => __( 'Icon Background Color', 'htmega-addons' ),
1005
+ 'type' => Controls_Manager::COLOR,
1006
+ 'selectors' => [
1007
+ '{{WRAPPER}} a.instagram_follow_btn i' => 'background-color: {{VALUE}}',
1008
+ ],
1009
+ ]
1010
+ );
1011
+
1012
+ $this->end_controls_section(); // Follow Button Style end
1013
+
1014
+
1015
+
1016
+ // Style instagram arrow style start
1017
+ $this->start_controls_section(
1018
+ 'htmega_instagram_arrow_style',
1019
+ [
1020
+ 'label' => __( 'Arrow', 'htmega-addons' ),
1021
+ 'tab' => Controls_Manager::TAB_STYLE,
1022
+ 'condition' =>[
1023
+ 'slider_on' => 'yes',
1024
+ 'slarrows' => 'yes',
1025
+ ],
1026
+ ]
1027
+ );
1028
+
1029
+ $this->start_controls_tabs( 'instagram_arrow_style_tabs' );
1030
+
1031
+ // Normal tab Start
1032
+ $this->start_controls_tab(
1033
+ 'instagram_arrow_style_normal_tab',
1034
+ [
1035
+ 'label' => __( 'Normal', 'htmega-addons' ),
1036
+ ]
1037
+ );
1038
+
1039
+ $this->add_control(
1040
+ 'htmega_instagram_arrow_color',
1041
+ [
1042
+ 'label' => __( 'Color', 'htmega-addons' ),
1043
+ 'type' => Controls_Manager::COLOR,
1044
+ 'default' => '#ffffff',
1045
+ 'selectors' => [
1046
+ '{{WRAPPER}} .htmega-instragram .slick-arrow' => 'color: {{VALUE}};',
1047
+ ],
1048
+ ]
1049
+ );
1050
+
1051
+ $this->add_control(
1052
+ 'htmega_instagram_arrow_fontsize',
1053
+ [
1054
+ 'label' => __( 'Font Size', 'htmega-addons' ),
1055
+ 'type' => Controls_Manager::SLIDER,
1056
+ 'size_units' => [ 'px', '%' ],
1057
+ 'range' => [
1058
+ 'px' => [
1059
+ 'min' => 0,
1060
+ 'max' => 100,
1061
+ 'step' => 1,
1062
+ ],
1063
+ '%' => [
1064
+ 'min' => 0,
1065
+ 'max' => 100,
1066
+ ],
1067
+ ],
1068
+ 'default' => [
1069
+ 'unit' => 'px',
1070
+ 'size' => 20,
1071
+ ],
1072
+ 'selectors' => [
1073
+ '{{WRAPPER}} .htmega-instragram .slick-arrow' => 'font-size: {{SIZE}}{{UNIT}};',
1074
+ ],
1075
+ ]
1076
+ );
1077
+
1078
+ $this->add_group_control(
1079
+ Group_Control_Background::get_type(),
1080
+ [
1081
+ 'name' => 'instagram_arrow_background',
1082
+ 'label' => __( 'Background', 'htmega-addons' ),
1083
+ 'types' => [ 'classic', 'gradient' ],
1084
+ 'selector' => '{{WRAPPER}} .htmega-instragram .slick-arrow',
1085
+ ]
1086
+ );
1087
+
1088
+ $this->add_group_control(
1089
+ Group_Control_Border::get_type(),
1090
+ [
1091
+ 'name' => 'htmega_instagram_arrow_border',
1092
+ 'label' => __( 'Border', 'htmega-addons' ),
1093
+ 'selector' => '{{WRAPPER}} .htmega-instragram .slick-arrow',
1094
+ ]
1095
+ );
1096
+
1097
+ $this->add_responsive_control(
1098
+ 'htmega_instagram_arrow_border_radius',
1099
+ [
1100
+ 'label' => esc_html__( 'Border Radius', 'htmega-addons' ),
1101
+ 'type' => Controls_Manager::DIMENSIONS,
1102
+ 'selectors' => [
1103
+ '{{WRAPPER}} .htmega-instragram .slick-arrow' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
1104
+ ],
1105
+ ]
1106
+ );
1107
+
1108
+ $this->add_control(
1109
+ 'htmega_instagram_arrow_height',
1110
+ [
1111
+ 'label' => __( 'Height', 'htmega-addons' ),
1112
+ 'type' => Controls_Manager::SLIDER,
1113
+ 'size_units' => [ 'px', '%' ],
1114
+ 'range' => [
1115
+ 'px' => [
1116
+ 'min' => 0,
1117
+ 'max' => 1000,
1118
+ 'step' => 1,
1119
+ ],
1120
+ '%' => [
1121
+ 'min' => 0,
1122
+ 'max' => 100,
1123
+ ],
1124
+ ],
1125
+ 'default' => [
1126
+ 'unit' => 'px',
1127
+ 'size' => 30,
1128
+ ],
1129
+ 'selectors' => [
1130
+ '{{WRAPPER}} .htmega-instragram .slick-arrow' => 'height: {{SIZE}}{{UNIT}};',
1131
+ ],
1132
+ ]
1133
+ );
1134
+
1135
+ $this->add_control(
1136
+ 'htmega_instagram_arrow_width',
1137
+ [
1138
+ 'label' => __( 'Width', 'htmega-addons' ),
1139
+ 'type' => Controls_Manager::SLIDER,
1140
+ 'size_units' => [ 'px', '%' ],
1141
+ 'range' => [
1142
+ 'px' => [
1143
+ 'min' => 0,
1144
+ 'max' => 1000,
1145
+ 'step' => 1,
1146
+ ],
1147
+ '%' => [
1148
+ 'min' => 0,
1149
+ 'max' => 100,
1150
+ ],
1151
+ ],
1152
+ 'default' => [
1153
+ 'unit' => 'px',
1154
+ 'size' => 30,
1155
+ ],
1156
+ 'selectors' => [
1157
+ '{{WRAPPER}} .htmega-instragram .slick-arrow' => 'width: {{SIZE}}{{UNIT}};',
1158
+ ],
1159
+ ]
1160
+ );
1161
+
1162
+ $this->add_responsive_control(
1163
+ 'htmega_instagram_arrow_padding',
1164
+ [
1165
+ 'label' => __( 'Padding', 'htmega-addons' ),
1166
+ 'type' => Controls_Manager::DIMENSIONS,
1167
+ 'size_units' => [ 'px', '%', 'em' ],
1168
+ 'selectors' => [
1169
+ '{{WRAPPER}} .htmega-instragram .slick-arrow' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1170
+ ],
1171
+ 'separator' =>'before',
1172
+ ]
1173
+ );
1174
+
1175
+ $this->end_controls_tab(); // Normal tab end
1176
+
1177
+ // Hover tab Start
1178
+ $this->start_controls_tab(
1179
+ 'instagram_arrow_style_hover_tab',
1180
+ [
1181
+ 'label' => __( 'Hover', 'htmega-addons' ),
1182
+ ]
1183
+ );
1184
+
1185
+ $this->add_control(
1186
+ 'htmega_instagram_arrow_hover_color',
1187
+ [
1188
+ 'label' => __( 'Color', 'htmega-addons' ),
1189
+ 'type' => Controls_Manager::COLOR,
1190
+ 'default' => '#ffffff',
1191
+ 'selectors' => [
1192
+ '{{WRAPPER}} .htmega-instragram .slick-arrow:hover' => 'color: {{VALUE}};',
1193
+ ],
1194
+ ]
1195
+ );
1196
+
1197
+ $this->add_group_control(
1198
+ Group_Control_Background::get_type(),
1199
+ [
1200
+ 'name' => 'instagram_arrow_hover_background',
1201
+ 'label' => __( 'Background', 'htmega-addons' ),
1202
+ 'types' => [ 'classic', 'gradient' ],
1203
+ 'selector' => '{{WRAPPER}} .htmega-instragram .slick-arrow:hover',
1204
+ ]
1205
+ );
1206
+
1207
+ $this->add_group_control(
1208
+ Group_Control_Border::get_type(),
1209
+ [
1210
+ 'name' => 'htmega_instagram_arrow_hover_border',
1211
+ 'label' => __( 'Border', 'htmega-addons' ),
1212
+ 'selector' => '{{WRAPPER}} .htmega-instragram .slick-arrow:hover',
1213
+ ]
1214
+ );
1215
+
1216
+ $this->add_responsive_control(
1217
+ 'htmega_instagram_arrow_hover_border_radius',
1218
+ [
1219
+ 'label' => esc_html__( 'Border Radius', 'htmega-addons' ),
1220
+ 'type' => Controls_Manager::DIMENSIONS,
1221
+ 'selectors' => [
1222
+ '{{WRAPPER}} .htmega-instragram .slick-arrow:hover' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
1223
+ ],
1224
+ ]
1225
+ );
1226
+
1227
+ $this->end_controls_tab(); // Hover tab end
1228
+
1229
+ $this->end_controls_tabs();
1230
+
1231
+ $this->end_controls_section(); // Style instagram arrow style end
1232
+
1233
+
1234
+ // Style instagram Dots style start
1235
+ $this->start_controls_section(
1236
+ 'htmega_instagram_dots_style',
1237
+ [
1238
+ 'label' => __( 'Pagination', 'htmega-addons' ),
1239
+ 'tab' => Controls_Manager::TAB_STYLE,
1240
+ 'condition' =>[
1241
+ 'slider_on' => 'yes',
1242
+ 'sldots' => 'yes',
1243
+ ],
1244
+ ]
1245
+ );
1246
+
1247
+ $this->start_controls_tabs( 'instagram_dots_style_tabs' );
1248
+
1249
+ // Normal tab Start
1250
+ $this->start_controls_tab(
1251
+ 'instagram_dots_style_normal_tab',
1252
+ [
1253
+ 'label' => __( 'Normal', 'htmega-addons' ),
1254
+ ]
1255
+ );
1256
+
1257
+ $this->add_group_control(
1258
+ Group_Control_Background::get_type(),
1259
+ [
1260
+ 'name' => 'instagram_dots_background',
1261
+ 'label' => __( 'Background', 'htmega-addons' ),
1262
+ 'types' => [ 'classic', 'gradient' ],
1263
+ 'selector' => '{{WRAPPER}} .htmega-instragram .slick-dots li',
1264
+ ]
1265
+ );
1266
+
1267
+ $this->add_group_control(
1268
+ Group_Control_Border::get_type(),
1269
+ [
1270
+ 'name' => 'htmega_instagram_dots_border',
1271
+ 'label' => __( 'Border', 'htmega-addons' ),
1272
+ 'selector' => '{{WRAPPER}} .htmega-instragram .slick-dots li',
1273
+ ]
1274
+ );
1275
+
1276
+ $this->add_responsive_control(
1277
+ 'htmega_instagram_dots_border_radius',
1278
+ [
1279
+ 'label' => esc_html__( 'Border Radius', 'htmega-addons' ),
1280
+ 'type' => Controls_Manager::DIMENSIONS,
1281
+ 'selectors' => [
1282
+ '{{WRAPPER}} .htmega-instragram .slick-dots li' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
1283
+ ],
1284
+ ]
1285
+ );
1286
+
1287
+ $this->add_control(
1288
+ 'htmega_instagram_dots_height',
1289
+ [
1290
+ 'label' => __( 'Height', 'htmega-addons' ),
1291
+ 'type' => Controls_Manager::SLIDER,
1292
+ 'size_units' => [ 'px', '%' ],
1293
+ 'range' => [
1294
+ 'px' => [
1295
+ 'min' => 0,
1296
+ 'max' => 1000,
1297
+ 'step' => 1,
1298
+ ],
1299
+ '%' => [
1300
+ 'min' => 0,
1301
+ 'max' => 100,
1302
+ ],
1303
+ ],
1304
+ 'default' => [
1305
+ 'unit' => 'px',
1306
+ 'size' => 15,
1307
+ ],
1308
+ 'selectors' => [
1309
+ '{{WRAPPER}} .htmega-instragram .slick-dots li' => 'height: {{SIZE}}{{UNIT}};',
1310
+ ],
1311
+ ]
1312
+ );
1313
+
1314
+ $this->add_control(
1315
+ 'htmega_instagram_dots_width',
1316
+ [
1317
+ 'label' => __( 'Width', 'htmega-addons' ),
1318
+ 'type' => Controls_Manager::SLIDER,
1319
+ 'size_units' => [ 'px', '%' ],
1320
+ 'range' => [
1321
+ 'px' => [
1322
+ 'min' => 0,
1323
+ 'max' => 1000,
1324
+ 'step' => 1,
1325
+ ],
1326
+ '%' => [
1327
+ 'min' => 0,
1328
+ 'max' => 100,
1329
+ ],
1330
+ ],
1331
+ 'default' => [
1332
+ 'unit' => 'px',
1333
+ 'size' => 15,
1334
+ ],
1335
+ 'selectors' => [
1336
+ '{{WRAPPER}} .htmega-instragram .slick-dots li' => 'width: {{SIZE}}{{UNIT}} !important;',
1337
+ ],
1338
+ ]
1339
+ );
1340
+
1341
+ $this->end_controls_tab(); // Normal tab end
1342
+
1343
+ // Hover tab Start
1344
+ $this->start_controls_tab(
1345
+ 'instagram_dots_style_hover_tab',
1346
+ [
1347
+ 'label' => __( 'Active', 'htmega-addons' ),
1348
+ ]
1349
+ );
1350
+
1351
+ $this->add_group_control(
1352
+ Group_Control_Background::get_type(),
1353
+ [
1354
+ 'name' => 'instagram_dots_hover_background',
1355
+ 'label' => __( 'Background', 'htmega-addons' ),
1356
+ 'types' => [ 'classic', 'gradient' ],
1357
+ 'selector' => '{{WRAPPER}} .htmega-instragram .slick-dots li.slick-active',
1358
+ ]
1359
+ );
1360
+
1361
+ $this->add_group_control(
1362
+ Group_Control_Border::get_type(),
1363
+ [
1364
+ 'name' => 'htmega_instagram_dots_hover_border',
1365
+ 'label' => __( 'Border', 'htmega-addons' ),
1366
+ 'selector' => '{{WRAPPER}} .htmega-instragram .slick-dots li.slick-active',
1367
+ ]
1368
+ );
1369
+
1370
+ $this->add_responsive_control(
1371
+ 'htmega_instagram_dots_hover_border_radius',
1372
+ [
1373
+ 'label' => esc_html__( 'Border Radius', 'htmega-addons' ),
1374
+ 'type' => Controls_Manager::DIMENSIONS,
1375
+ 'selectors' => [
1376
+ '{{WRAPPER}} .htmega-instragram .slick-dots li.slick-active' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
1377
+ ],
1378
+ ]
1379
+ );
1380
+
1381
+ $this->end_controls_tab(); // Hover tab end
1382
+
1383
+ $this->end_controls_tabs();
1384
+
1385
+ $this->end_controls_section(); // Style instagram dots style end
1386
+
1387
+ }
1388
+
1389
+ protected function render( $instance = [] ) {
1390
+
1391
+ $settings = $this->get_settings_for_display();
1392
+ $id = $this->get_id();
1393
+
1394
+ $this->add_render_attribute( 'htmega_instragram', 'class', 'htmega-instragram' );
1395
+ $this->add_render_attribute( 'htmega_instragram', 'class', 'htmega-instragram-style-'.$settings['instagram_style'] );
1396
+ $imagesize = (int)$settings['instagram_image_size'];
1397
+
1398
+ $limit = !empty( $settings['limit'] ) ? $settings['limit'] : 8;
1399
+ $username = !empty( $settings['username'] ) ? $settings['username'] : 'portfolio.devitems';
1400
+ $profile_link = 'https://www.instagram.com/'.$username;
1401
+
1402
+
1403
+ if( $settings['slider_on'] == 'yes' ){
1404
+
1405
+ $slider_settings = [
1406
+ 'arrows' => ('yes' === $settings['slarrows']),
1407
+ 'arrow_prev_txt' => HTMega_Icon_manager::render_icon( $settings['slprevicon'], [ 'aria-hidden' => 'true' ] ),
1408
+ 'arrow_next_txt' => HTMega_Icon_manager::render_icon( $settings['slnexticon'], [ 'aria-hidden' => 'true' ] ),
1409
+ 'dots' => ('yes' === $settings['sldots']),
1410
+ 'autoplay' => ('yes' === $settings['slautolay']),
1411
+ 'autoplay_speed' => absint($settings['slautoplay_speed']),
1412
+ 'animation_speed' => absint($settings['slanimation_speed']),
1413
+ 'pause_on_hover' => ('yes' === $settings['slpause_on_hover']),
1414
+ 'center_mode' => ( 'yes' === $settings['slcentermode']),
1415
+ 'center_padding' => absint($settings['slcenterpadding']),
1416
+ ];
1417
+
1418
+ $slider_responsive_settings = [
1419
+ 'display_columns' => $settings['slitems'],
1420
+ 'scroll_columns' => $settings['slscroll_columns'],
1421
+ 'tablet_width' => $settings['sltablet_width'],
1422
+ 'tablet_display_columns' => $settings['sltablet_display_columns'],
1423
+ 'tablet_scroll_columns' => $settings['sltablet_scroll_columns'],
1424
+ 'mobile_width' => $settings['slmobile_width'],
1425
+ 'mobile_display_columns' => $settings['slmobile_display_columns'],
1426
+ 'mobile_scroll_columns' => $settings['slmobile_scroll_columns'],
1427
+
1428
+ ];
1429
+
1430
+ $slider_settings = array_merge( $slider_settings, $slider_responsive_settings );
1431
+ }else{
1432
+ $slider_settings = [];
1433
+ }
1434
+
1435
+ ?>
1436
+ <div <?php echo $this->get_render_attribute_string('htmega_instragram'); ?> >
1437
+
1438
+ <div id="htmega-instagram-list-<?php echo $id; ?>"></div>
1439
+
1440
+ <?php
1441
+ if( $settings['show_flow_button'] == 'yes' ):
1442
+ $flowtxt = $settings['flow_button_txt'].' '.$username;
1443
+ ?>
1444
+ <a class="instagram_follow_btn" href="<?php echo esc_url( $profile_link ); ?>" target="_blank">
1445
+ <?php echo HTMega_Icon_manager::render_icon( $settings['flow_button_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1446
+ <span><?php echo esc_html__( $flowtxt, 'htmega-addons' );?></span>
1447
+ </a>
1448
+ <?php endif; ?>
1449
+
1450
+ </div>
1451
+
1452
+ <?php
1453
+ $zoo_image = '';
1454
+ if( !empty( $settings['zoom_image'] ) && $settings['zoomicon_type'] == 'img' ){
1455
+ $zoo_image = Group_Control_Image_Size::get_attachment_image_html( $settings, 'zoom_imagesize', 'zoom_image' );
1456
+ }else{
1457
+ $zoo_image = sprintf('<span class="zoom_icon">%1$s</span>', HTMega_Icon_manager::render_icon( $settings['zoom_icon'], [ 'aria-hidden' => 'true' ] ) );
1458
+ }
1459
+ ?>
1460
+
1461
+ <script type="text/javascript">
1462
+ ;jQuery(document).ready(function($) {
1463
+ 'use strict';
1464
+
1465
+ var limit = <?php echo $limit; ?>,
1466
+ id = '<?php echo $id; ?>',
1467
+ username = '<?php echo $username; ?>',
1468
+ img_size = <?php echo $imagesize; ?>,
1469
+ slider_on = '<?php echo $settings['slider_on']; ?>';
1470
+
1471
+ // Meta Option
1472
+ var comment = '<?php echo $settings['show_comment']; ?>',
1473
+ like = '<?php echo $settings['show_like']; ?>',
1474
+ lightbox = '<?php echo $settings['show_light_box']; ?>',
1475
+ like_icon = '<?php echo HTMega_Icon_manager::render_icon( $settings['like_icon'], [ 'aria-hidden' => 'true' ] ); ?>',
1476
+ comment_icon = '<?php echo HTMega_Icon_manager::render_icon( $settings['comment_icon'], [ 'aria-hidden' => 'true' ] ); ?>',
1477
+ zoo_image = '<?php echo $zoo_image; ?>',
1478
+ lazy_load = '<?php echo $settings['lazy_load']; ?>';
1479
+
1480
+ // Slider Option
1481
+ if( slider_on == 'yes' ){
1482
+ var slider_opt = <?php echo wp_json_encode( $slider_settings ); ?>;
1483
+ var arrows = slider_opt['arrows'],
1484
+ arrow_prev_txt = slider_opt['arrow_prev_txt'],
1485
+ arrow_next_txt = slider_opt['arrow_next_txt'],
1486
+ dots = slider_opt['dots'],
1487
+ autoplay = slider_opt['autoplay'],
1488
+ autoplay_speed = parseInt(slider_opt['autoplay_speed']) || 3000,
1489
+ animation_speed = parseInt(slider_opt['animation_speed']) || 300,
1490
+ pause_on_hover = slider_opt['pause_on_hover'],
1491
+ center_mode = slider_opt['center_mode'],
1492
+ center_padding = slider_opt['center_padding'] ? slider_opt['center_padding'] : '50px',
1493
+ display_columns = parseInt(slider_opt['display_columns']) || 1,
1494
+ scroll_columns = parseInt(slider_opt['scroll_columns']) || 1,
1495
+ tablet_width = parseInt(slider_opt['tablet_width']) || 800,
1496
+ tablet_display_columns = parseInt(slider_opt['tablet_display_columns']) || 1,
1497
+ tablet_scroll_columns = parseInt(slider_opt['tablet_scroll_columns']) || 1,
1498
+ mobile_width = parseInt(slider_opt['mobile_width']) || 480,
1499
+ mobile_display_columns = parseInt(slider_opt['mobile_display_columns']) || 1,
1500
+ mobile_scroll_columns = parseInt(slider_opt['mobile_scroll_columns']) || 1;
1501
+ }
1502
+
1503
+ // Manage Image Size
1504
+ var image_sizes = {
1505
+ "150": 0,
1506
+ "240": 1,
1507
+ "320": 2,
1508
+ "480": 3,
1509
+ "640": 4
1510
+ };
1511
+
1512
+ //image size
1513
+ var image_index = typeof image_sizes[img_size] !== "undefined" ? image_sizes[img_size] : image_sizes[640];
1514
+
1515
+ // Clear localStorage data
1516
+ var clearLocalData = '<?php echo $settings['clear_cache_data']; ?>';
1517
+ if( clearLocalData == 'yes' ){
1518
+ window.localStorage.clear();
1519
+ }
1520
+
1521
+ // Display Instagram item
1522
+ function htMegaDisplayInstagramFeed( data ){
1523
+ var html = "<ul class='htmega-instagram-list'>";
1524
+ var imgs = (data.edge_owner_to_timeline_media || data.edge_hashtag_to_media).edges,
1525
+ max = ( imgs.length > limit ) ? limit : imgs.length;
1526
+
1527
+ for (var i = 0; i < max; i++) {
1528
+ var url = "https://www.instagram.com/p/" + imgs[i].node.shortcode,
1529
+ image, fullimage, type_resource, caption;
1530
+
1531
+ switch (imgs[i].node.__typename) {
1532
+ case "GraphSidecar":
1533
+ type_resource = "sidecar"
1534
+ image = imgs[i].node.thumbnail_resources[image_index].src;
1535
+ fullimage = imgs[i].node.thumbnail_src;
1536
+ break;
1537
+ case "GraphVideo":
1538
+ type_resource = "video";
1539
+ image = imgs[i].node.thumbnail_src
1540
+ fullimage = imgs[i].node.thumbnail_src;
1541
+ break;
1542
+ default:
1543
+ type_resource = "image";
1544
+ image = imgs[i].node.thumbnail_resources[image_index].src;
1545
+ fullimage = imgs[i].node.thumbnail_src;
1546
+ }
1547
+
1548
+ if (
1549
+ typeof imgs[i].node.edge_media_to_caption.edges[0] !== "undefined" &&
1550
+ typeof imgs[i].node.edge_media_to_caption.edges[0].node !== "undefined" &&
1551
+ typeof imgs[i].node.edge_media_to_caption.edges[0].node.text !== "undefined" &&
1552
+ imgs[i].node.edge_media_to_caption.edges[0].node.text !== null
1553
+ ) {
1554
+ caption = imgs[i].node.edge_media_to_caption.edges[0].node.text;
1555
+ } else if (
1556
+ typeof imgs[i].node.accessibility_caption !== "undefined" &&
1557
+ imgs[i].node.accessibility_caption !== null
1558
+ ) {
1559
+ caption = imgs[i].node.accessibility_caption;
1560
+ } else {
1561
+ caption = (is_tag ? data.name : data.username) + " image " + i;
1562
+ }
1563
+
1564
+ html += '<li>';
1565
+ html += "<a href='" + url + "' rel='noopener' target='_blank'>";
1566
+ html += "<img" + (lazy_load == 'yes' ? " loading='lazy'" : '') +" src='" + image + "' alt='" + caption + "' />";
1567
+ html += "</a>";
1568
+
1569
+ if( comment == 'yes' || like == 'yes' || lightbox == 'yes' ){
1570
+
1571
+ html += '<div class="instagram-clip"><div class="htmega-content">';
1572
+
1573
+ if( comment == 'yes' || like == 'yes' ){
1574
+ html += '<div class="instagram-like-comment">';
1575
+ if( like == 'yes' ){
1576
+ html += '<span class="like">'+like_icon+imgs[i].node.edge_liked_by.count+'</span>';
1577
+ }
1578
+ if( comment == 'yes' ){
1579
+ html += '<span class="comment">'+comment_icon+imgs[i].node.edge_media_to_comment.count+'</span>';
1580
+ }
1581
+ html +='</div>';
1582
+ }
1583
+
1584
+ if( lightbox == 'yes' ){
1585
+ html += '<div class="instagram-btn">';
1586
+ html += '<a class="image-popup-vertical-fit" href="'+ fullimage +'">'+zoo_image+'</a>';
1587
+ html += '</div>';
1588
+ }
1589
+
1590
+ html += '</div></div>';
1591
+ }
1592
+
1593
+
1594
+ html += '</li>';
1595
+ }
1596
+
1597
+ html += '</ul>';
1598
+
1599
+ $( "#htmega-instagram-list-"+id ).html( html );
1600
+ }
1601
+
1602
+ // Instagram Feed
1603
+ if( window.localStorage.getItem( "htmega_instragram_local_data_status"+id ) === 'true' ){
1604
+ var localdata = window.localStorage.getItem( "htmega_instragram_local_data_"+id );
1605
+ htMegaDisplayInstagramFeed( JSON.parse( localdata ) );
1606
+ }else{
1607
+ $.instagramFeed({
1608
+ 'username': username,
1609
+ 'callback': function( data ){
1610
+ window.localStorage.setItem( "htmega_instragram_local_data_"+id, JSON.stringify( data ) );
1611
+ window.localStorage.setItem( "htmega_instragram_local_data_status"+id, 'true' );
1612
+ htMegaDisplayInstagramFeed( data );
1613
+ }
1614
+ });
1615
+ }
1616
+
1617
+ if( slider_on == 'yes' ){
1618
+
1619
+ function htMegaInstagramSlider( selector = 'htmega-instagram-list' ){
1620
+ $("#htmega-instagram-list-"+id+" ." + selector ).slick({
1621
+ arrows: arrows,
1622
+ prevArrow: '<button class="htmega-carosul-prev">'+arrow_prev_txt+'</button>',
1623
+ nextArrow: '<button class="htmega-carosul-next">'+arrow_next_txt+'</button>',
1624
+ dots: dots,
1625
+ infinite: true,
1626
+ autoplay: autoplay,
1627
+ autoplaySpeed: autoplay_speed,
1628
+ speed: animation_speed,
1629
+ fade: false,
1630
+ pauseOnHover: pause_on_hover,
1631
+ slidesToShow: display_columns,
1632
+ slidesToScroll: scroll_columns,
1633
+ centerMode: center_mode,
1634
+ centerPadding: center_padding,
1635
+ responsive: [
1636
+ {
1637
+ breakpoint: tablet_width,
1638
+ settings: {
1639
+ slidesToShow: tablet_display_columns,
1640
+ slidesToScroll: tablet_scroll_columns
1641
+ }
1642
+ },
1643
+ {
1644
+ breakpoint: mobile_width,
1645
+ settings: {
1646
+ slidesToShow: mobile_display_columns,
1647
+ slidesToScroll: mobile_scroll_columns
1648
+ }
1649
+ }
1650
+ ]
1651
+ })
1652
+ }
1653
+
1654
+ if( window.localStorage.getItem( "htmega_instragram_local_data_status"+id ) === 'true' ){
1655
+ htMegaInstagramSlider();
1656
+ }else{
1657
+ $("#htmega-instagram-list-"+id).on("DOMNodeInserted", function (e) {
1658
+ if ( e.target.className == 'htmega-instagram-list' ) {
1659
+ htMegaInstagramSlider();
1660
+ }
1661
+ });
1662
+ }
1663
+
1664
+ }
1665
+
1666
+ });
1667
+ </script>
1668
+
1669
+ <?php
1670
+ }
1671
+
1672
+ }
includes/widgets/htmega_instagram.php CHANGED
@@ -30,7 +30,6 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
30
 
31
  public function get_script_depends() {
32
  return [
33
- 'htmegainstagramfeed',
34
  'slick',
35
  'htmega-widgets-scripts',
36
  ];
@@ -57,17 +56,57 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
57
  '3' => __( 'Style Three', 'htmega-addons' ),
58
  '4' => __( 'Style Four', 'htmega-addons' ),
59
  ],
60
- 'label_block' => true,
61
  ]
62
  );
63
 
 
 
 
 
 
 
 
 
 
 
 
64
  $this->add_control(
65
- 'username',
66
  [
67
- 'label' => __( 'Instagram UserName', 'htmega-addons' ),
68
  'type' => Controls_Manager::TEXT,
69
- 'placeholder' => __( 'portfolio.devitems', 'htmega-addons' ),
70
  'label_block' =>true,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  ]
72
  );
73
 
@@ -117,49 +156,9 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
117
  );
118
 
119
  $this->add_control(
120
- 'instagram_image_size',
121
- [
122
- 'label' => __( 'Image Size', 'htmega-addons' ),
123
- 'type' => Controls_Manager::SELECT,
124
- 'default' => '480',
125
- 'options' => [
126
- '150' => __( '150', 'htmega-addons' ),
127
- '240' => __( '240', 'htmega-addons' ),
128
- '320' => __( '320', 'htmega-addons' ),
129
- '480' => __( '480', 'htmega-addons' ),
130
- '640' => __( '640', 'htmega-addons' ),
131
- ],
132
- ]
133
- );
134
-
135
- $this->add_control(
136
- 'clear_cache_data',
137
  [
138
- 'label' => esc_html__( 'Clear Cache Data', 'htmega-addons' ),
139
- 'type' => Controls_Manager::SWITCHER,
140
- 'label_on' => esc_html__( 'Yes', 'htmega-addons' ),
141
- 'label_off' => esc_html__( 'No', 'htmega-addons' ),
142
- 'return_value' => 'yes',
143
- 'default' => 'no',
144
- ]
145
- );
146
-
147
- $this->add_control(
148
- 'lazy_load',
149
- [
150
- 'label' => __( 'Lazy Load', 'htmega-addons' ),
151
- 'type' => Controls_Manager::SWITCHER,
152
- 'label_on' => __( 'Show', 'htmega-addons' ),
153
- 'label_off' => __( 'Hide', 'htmega-addons' ),
154
- 'return_value' => 'yes',
155
- 'default' => 'no',
156
- ]
157
- );
158
-
159
- $this->add_control(
160
- 'show_like',
161
- [
162
- 'label' => __( 'Show Like', 'htmega-addons' ),
163
  'type' => Controls_Manager::SWITCHER,
164
  'label_on' => __( 'Show', 'htmega-addons' ),
165
  'label_off' => __( 'Hide', 'htmega-addons' ),
@@ -169,9 +168,9 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
169
  );
170
 
171
  $this->add_control(
172
- 'show_comment',
173
  [
174
- 'label' => __( 'Show Comment', 'htmega-addons' ),
175
  'type' => Controls_Manager::SWITCHER,
176
  'label_on' => __( 'Show', 'htmega-addons' ),
177
  'label_off' => __( 'Hide', 'htmega-addons' ),
@@ -181,9 +180,9 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
181
  );
182
 
183
  $this->add_control(
184
- 'show_light_box',
185
  [
186
- 'label' => __( 'Show Light Box', 'htmega-addons' ),
187
  'type' => Controls_Manager::SWITCHER,
188
  'label_on' => __( 'Show', 'htmega-addons' ),
189
  'label_off' => __( 'Hide', 'htmega-addons' ),
@@ -193,14 +192,15 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
193
  );
194
 
195
  $this->add_control(
196
- 'show_flow_button',
197
  [
198
- 'label' => __( 'Show Follow Button', 'htmega-addons' ),
199
- 'type' => Controls_Manager::SWITCHER,
200
- 'label_on' => __( 'Show', 'htmega-addons' ),
201
- 'label_off' => __( 'Hide', 'htmega-addons' ),
202
- 'return_value' => 'yes',
203
- 'default' => 'yes',
 
204
  ]
205
  );
206
 
@@ -231,7 +231,7 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
231
  'icon' =>'fa fa-info',
232
  ]
233
  ],
234
- 'default' =>'icon',
235
  'condition' =>[
236
  'show_light_box' =>'yes',
237
  ],
@@ -241,7 +241,7 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
241
  $this->add_control(
242
  'zoom_image',
243
  [
244
- 'label' => __('Zoom Image Icon','htmega-addons'),
245
  'type'=>Controls_Manager::MEDIA,
246
  'dynamic' => [
247
  'active' => true,
@@ -262,11 +262,6 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
262
  'condition' => [
263
  'show_light_box' =>'yes',
264
  'zoomicon_type' => 'img',
265
- ],
266
- 'fields_options'=>[
267
- 'size'=>[
268
- 'label' => __('Zoom Icon Size','htmega-addons')
269
- ]
270
  ]
271
  ]
272
  );
@@ -287,36 +282,6 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
287
  ]
288
  );
289
 
290
- $this->add_control(
291
- 'comment_icon',
292
- [
293
- 'label' =>__('Comment Icon','htmega-addons'),
294
- 'type'=>Controls_Manager::ICONS,
295
- 'default' => [
296
- 'value'=>'far fa-comment',
297
- 'library' => 'solid',
298
- ],
299
- 'condition' => [
300
- 'show_comment' =>'yes',
301
- ]
302
- ]
303
- );
304
-
305
- $this->add_control(
306
- 'like_icon',
307
- [
308
- 'label' =>__('Like Icon','htmega-addons'),
309
- 'type'=>Controls_Manager::ICONS,
310
- 'default' => [
311
- 'value'=>'far fa-heart',
312
- 'library' => 'solid',
313
- ],
314
- 'condition' => [
315
- 'show_like' =>'yes',
316
- ]
317
- ]
318
- );
319
-
320
  $this->add_control(
321
  'flow_button_icon',
322
  [
@@ -332,15 +297,6 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
332
  ]
333
  );
334
 
335
- $this->add_control(
336
- 'flow_button_txt',
337
- [
338
- 'label' => __( 'Flow Button Prefix', 'htmega-addons' ),
339
- 'type' => Controls_Manager::TEXT,
340
- 'default' => __( 'Follow @', 'htmega-addons' ),
341
- ]
342
- );
343
-
344
  $this->end_controls_section();
345
 
346
  // Slider setting
@@ -497,6 +453,7 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
497
  ]
498
  );
499
 
 
500
  $this->add_control(
501
  'slanimation_speed',
502
  [
@@ -751,6 +708,10 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
751
  [
752
  'label' => __( 'Overlay Color', 'htmega-addons' ),
753
  'type' => Controls_Manager::COLOR,
 
 
 
 
754
  'default' => 'rgba(0, 0, 0, 0.7)',
755
  'selectors' => [
756
  '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip::before' => 'background-color: {{VALUE}};',
@@ -764,7 +725,7 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
764
  $this->start_controls_section(
765
  'htmega_instagram_icon_style_section',
766
  [
767
- 'label' => __( 'Zoom Icon', 'htmega-addons' ),
768
  'tab' => Controls_Manager::TAB_STYLE,
769
  'condition' =>[
770
  'zoomicon_type'=>'icon',
@@ -806,6 +767,10 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
806
  [
807
  'label' => __( 'Color', 'htmega-addons' ),
808
  'type' => Controls_Manager::COLOR,
 
 
 
 
809
  'default' => '#ffffff',
810
  'selectors' => [
811
  '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon i' => 'color: {{VALUE}};',
@@ -860,9 +825,9 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
860
 
861
  // Zoom icon Style
862
  $this->start_controls_section(
863
- 'htmega_instagram_commentlike_style_section',
864
  [
865
- 'label' => __( 'Comment & Like', 'htmega-addons' ),
866
  'tab' => Controls_Manager::TAB_STYLE,
867
  ]
868
  );
@@ -889,7 +854,7 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
889
  'size' => 16,
890
  ],
891
  'selectors' => [
892
- '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'font-size: {{SIZE}}{{UNIT}};',
893
  ],
894
  ]
895
  );
@@ -899,9 +864,8 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
899
  [
900
  'label' => __( 'Color', 'htmega-addons' ),
901
  'type' => Controls_Manager::COLOR,
902
- 'default' => '#ffffff',
903
  'selectors' => [
904
- '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'color: {{VALUE}};',
905
  ],
906
  ]
907
  );
@@ -913,7 +877,7 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
913
  'type' => Controls_Manager::DIMENSIONS,
914
  'size_units' => [ 'px', '%', 'em' ],
915
  'selectors' => [
916
- '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
917
  ],
918
  ]
919
  );
@@ -925,94 +889,13 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
925
  'type' => Controls_Manager::DIMENSIONS,
926
  'size_units' => [ 'px', '%', 'em' ],
927
  'selectors' => [
928
- '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
929
- ],
930
- ]
931
- );
932
-
933
- $this->add_group_control(
934
- Group_Control_Border::get_type(),
935
- [
936
- 'name' => 'instagram_commentlike_border',
937
- 'label' => __( 'Border', 'htmega-addons' ),
938
- 'selector' => '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span',
939
- ]
940
- );
941
-
942
- $this->add_responsive_control(
943
- 'instagram_commentlike_border_radius',
944
- [
945
- 'label' => esc_html__( 'Border Radius', 'htmega-addons' ),
946
- 'type' => Controls_Manager::DIMENSIONS,
947
- 'selectors' => [
948
- '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment span' => 'border-radius: {{TOP}}px {{RIGHT}}px {{BOTTOM}}px {{LEFT}}px;',
949
  ],
950
  ]
951
  );
952
 
953
  $this->end_controls_section(); // Zoom icon Style end
954
 
955
- // Style Follow Button style start
956
- $this->start_controls_section(
957
- 'htmega_instagram_follow_btn_style',
958
- [
959
- 'label' => __( 'Follow Button', 'htmega-addons' ),
960
- 'tab' => Controls_Manager::TAB_STYLE,
961
- 'condition' =>[
962
- 'show_flow_button' => 'yes',
963
- ],
964
- ]
965
- );
966
-
967
- $this->add_control(
968
- 'follow_btn_margin',
969
- [
970
- 'label' => __( 'Margin', 'htmega-addons' ),
971
- 'type' => Controls_Manager::DIMENSIONS,
972
- 'size_units' => [ 'px', '%', 'em' ],
973
- 'selectors' => [
974
- '{{WRAPPER}} a.instagram_follow_btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
975
- ],
976
- ]
977
- );
978
-
979
- $this->add_control(
980
- 'follow_btn_color',
981
- [
982
- 'label' => __( 'Color', 'htmega-addons' ),
983
- 'type' => Controls_Manager::COLOR,
984
- 'selectors' => [
985
- '{{WRAPPER}} a.instagram_follow_btn' => 'color: {{VALUE}}',
986
- ],
987
- ]
988
- );
989
-
990
- $this->add_control(
991
- 'follow_btn_bg_color',
992
- [
993
- 'label' => __( 'Background Color', 'htmega-addons' ),
994
- 'type' => Controls_Manager::COLOR,
995
- 'selectors' => [
996
- '{{WRAPPER}} a.instagram_follow_btn' => 'background-color: {{VALUE}}',
997
- ],
998
- ]
999
- );
1000
-
1001
- $this->add_control(
1002
- 'follow_btn_icon_bg_color',
1003
- [
1004
- 'label' => __( 'Icon Background Color', 'htmega-addons' ),
1005
- 'type' => Controls_Manager::COLOR,
1006
- 'selectors' => [
1007
- '{{WRAPPER}} a.instagram_follow_btn i' => 'background-color: {{VALUE}}',
1008
- ],
1009
- ]
1010
- );
1011
-
1012
- $this->end_controls_section(); // Follow Button Style end
1013
-
1014
-
1015
-
1016
  // Style instagram arrow style start
1017
  $this->start_controls_section(
1018
  'htmega_instagram_arrow_style',
@@ -1041,6 +924,10 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
1041
  [
1042
  'label' => __( 'Color', 'htmega-addons' ),
1043
  'type' => Controls_Manager::COLOR,
 
 
 
 
1044
  'default' => '#ffffff',
1045
  'selectors' => [
1046
  '{{WRAPPER}} .htmega-instragram .slick-arrow' => 'color: {{VALUE}};',
@@ -1187,6 +1074,10 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
1187
  [
1188
  'label' => __( 'Color', 'htmega-addons' ),
1189
  'type' => Controls_Manager::COLOR,
 
 
 
 
1190
  'default' => '#ffffff',
1191
  'selectors' => [
1192
  '{{WRAPPER}} .htmega-instragram .slick-arrow:hover' => 'color: {{VALUE}};',
@@ -1387,21 +1278,65 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
1387
  }
1388
 
1389
  protected function render( $instance = [] ) {
1390
-
1391
  $settings = $this->get_settings_for_display();
1392
  $id = $this->get_id();
1393
 
1394
  $this->add_render_attribute( 'htmega_instragram', 'class', 'htmega-instragram' );
1395
  $this->add_render_attribute( 'htmega_instragram', 'class', 'htmega-instragram-style-'.$settings['instagram_style'] );
1396
- $imagesize = (int)$settings['instagram_image_size'];
1397
 
1398
- $limit = !empty( $settings['limit'] ) ? $settings['limit'] : 8;
1399
- $username = !empty( $settings['username'] ) ? $settings['username'] : 'portfolio.devitems';
1400
- $profile_link = 'https://www.instagram.com/'.$username;
1401
 
1402
-
1403
- if( $settings['slider_on'] == 'yes' ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1404
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1405
  $slider_settings = [
1406
  'arrows' => ('yes' === $settings['slarrows']),
1407
  'arrow_prev_txt' => HTMega_Icon_manager::render_icon( $settings['slprevicon'], [ 'aria-hidden' => 'true' ] ),
@@ -1428,245 +1363,92 @@ class HTMega_Elementor_Widget_Instagram extends Widget_Base {
1428
  ];
1429
 
1430
  $slider_settings = array_merge( $slider_settings, $slider_responsive_settings );
1431
- }else{
1432
- $slider_settings = [];
1433
  }
1434
 
1435
  ?>
1436
  <div <?php echo $this->get_render_attribute_string('htmega_instragram'); ?> >
1437
 
1438
- <div id="htmega-instagram-list-<?php echo $id; ?>"></div>
1439
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1440
  <?php
1441
  if( $settings['show_flow_button'] == 'yes' ):
1442
- $flowtxt = $settings['flow_button_txt'].' '.$username;
1443
  ?>
1444
  <a class="instagram_follow_btn" href="<?php echo esc_url( $profile_link ); ?>" target="_blank">
1445
  <?php echo HTMega_Icon_manager::render_icon( $settings['flow_button_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1446
- <span><?php echo esc_html__( $flowtxt, 'htmega-addons' );?></span>
1447
  </a>
1448
  <?php endif; ?>
1449
 
1450
  </div>
1451
 
1452
- <?php
1453
- $zoo_image = '';
1454
- if( !empty( $settings['zoom_image'] ) && $settings['zoomicon_type'] == 'img' ){
1455
- $zoo_image = Group_Control_Image_Size::get_attachment_image_html( $settings, 'zoom_imagesize', 'zoom_image' );
1456
- }else{
1457
- $zoo_image = sprintf('<span class="zoom_icon">%1$s</span>', HTMega_Icon_manager::render_icon( $settings['zoom_icon'], [ 'aria-hidden' => 'true' ] ) );
1458
- }
1459
- ?>
1460
-
1461
- <script type="text/javascript">
1462
- ;jQuery(document).ready(function($) {
1463
- 'use strict';
1464
-
1465
- var limit = <?php echo $limit; ?>,
1466
- id = '<?php echo $id; ?>',
1467
- username = '<?php echo $username; ?>',
1468
- img_size = <?php echo $imagesize; ?>,
1469
- slider_on = '<?php echo $settings['slider_on']; ?>';
1470
-
1471
- // Meta Option
1472
- var comment = '<?php echo $settings['show_comment']; ?>',
1473
- like = '<?php echo $settings['show_like']; ?>',
1474
- lightbox = '<?php echo $settings['show_light_box']; ?>',
1475
- like_icon = '<?php echo HTMega_Icon_manager::render_icon( $settings['like_icon'], [ 'aria-hidden' => 'true' ] ); ?>',
1476
- comment_icon = '<?php echo HTMega_Icon_manager::render_icon( $settings['comment_icon'], [ 'aria-hidden' => 'true' ] ); ?>',
1477
- zoo_image = '<?php echo $zoo_image; ?>',
1478
- lazy_load = '<?php echo $settings['lazy_load']; ?>';
1479
-
1480
- // Slider Option
1481
- if( slider_on == 'yes' ){
1482
- var slider_opt = <?php echo wp_json_encode( $slider_settings ); ?>;
1483
- var arrows = slider_opt['arrows'],
1484
- arrow_prev_txt = slider_opt['arrow_prev_txt'],
1485
- arrow_next_txt = slider_opt['arrow_next_txt'],
1486
- dots = slider_opt['dots'],
1487
- autoplay = slider_opt['autoplay'],
1488
- autoplay_speed = parseInt(slider_opt['autoplay_speed']) || 3000,
1489
- animation_speed = parseInt(slider_opt['animation_speed']) || 300,
1490
- pause_on_hover = slider_opt['pause_on_hover'],
1491
- center_mode = slider_opt['center_mode'],
1492
- center_padding = slider_opt['center_padding'] ? slider_opt['center_padding'] : '50px',
1493
- display_columns = parseInt(slider_opt['display_columns']) || 1,
1494
- scroll_columns = parseInt(slider_opt['scroll_columns']) || 1,
1495
- tablet_width = parseInt(slider_opt['tablet_width']) || 800,
1496
- tablet_display_columns = parseInt(slider_opt['tablet_display_columns']) || 1,
1497
- tablet_scroll_columns = parseInt(slider_opt['tablet_scroll_columns']) || 1,
1498
- mobile_width = parseInt(slider_opt['mobile_width']) || 480,
1499
- mobile_display_columns = parseInt(slider_opt['mobile_display_columns']) || 1,
1500
- mobile_scroll_columns = parseInt(slider_opt['mobile_scroll_columns']) || 1;
1501
- }
1502
-
1503
- // Manage Image Size
1504
- var image_sizes = {
1505
- "150": 0,
1506
- "240": 1,
1507
- "320": 2,
1508
- "480": 3,
1509
- "640": 4
1510
- };
1511
-
1512
- //image size
1513
- var image_index = typeof image_sizes[img_size] !== "undefined" ? image_sizes[img_size] : image_sizes[640];
1514
-
1515
- // Clear localStorage data
1516
- var clearLocalData = '<?php echo $settings['clear_cache_data']; ?>';
1517
- if( clearLocalData == 'yes' ){
1518
- window.localStorage.clear();
1519
- }
1520
-
1521
- // Display Instagram item
1522
- function htMegaDisplayInstagramFeed( data ){
1523
- var html = "<ul class='htmega-instagram-list'>";
1524
- var imgs = (data.edge_owner_to_timeline_media || data.edge_hashtag_to_media).edges,
1525
- max = ( imgs.length > limit ) ? limit : imgs.length;
1526
-
1527
- for (var i = 0; i < max; i++) {
1528
- var url = "https://www.instagram.com/p/" + imgs[i].node.shortcode,
1529
- image, fullimage, type_resource, caption;
1530
-
1531
- switch (imgs[i].node.__typename) {
1532
- case "GraphSidecar":
1533
- type_resource = "sidecar"
1534
- image = imgs[i].node.thumbnail_resources[image_index].src;
1535
- fullimage = imgs[i].node.thumbnail_src;
1536
- break;
1537
- case "GraphVideo":
1538
- type_resource = "video";
1539
- image = imgs[i].node.thumbnail_src
1540
- fullimage = imgs[i].node.thumbnail_src;
1541
- break;
1542
- default:
1543
- type_resource = "image";
1544
- image = imgs[i].node.thumbnail_resources[image_index].src;
1545
- fullimage = imgs[i].node.thumbnail_src;
1546
- }
1547
-
1548
- if (
1549
- typeof imgs[i].node.edge_media_to_caption.edges[0] !== "undefined" &&
1550
- typeof imgs[i].node.edge_media_to_caption.edges[0].node !== "undefined" &&
1551
- typeof imgs[i].node.edge_media_to_caption.edges[0].node.text !== "undefined" &&
1552
- imgs[i].node.edge_media_to_caption.edges[0].node.text !== null
1553
- ) {
1554
- caption = imgs[i].node.edge_media_to_caption.edges[0].node.text;
1555
- } else if (
1556
- typeof imgs[i].node.accessibility_caption !== "undefined" &&
1557
- imgs[i].node.accessibility_caption !== null
1558
- ) {
1559
- caption = imgs[i].node.accessibility_caption;
1560
- } else {
1561
- caption = (is_tag ? data.name : data.username) + " image " + i;
1562
- }
1563
-
1564
- html += '<li>';
1565
- html += "<a href='" + url + "' rel='noopener' target='_blank'>";
1566
- html += "<img" + (lazy_load == 'yes' ? " loading='lazy'" : '') +" src='" + image + "' alt='" + caption + "' />";
1567
- html += "</a>";
1568
-
1569
- if( comment == 'yes' || like == 'yes' || lightbox == 'yes' ){
1570
-
1571
- html += '<div class="instagram-clip"><div class="htmega-content">';
1572
-
1573
- if( comment == 'yes' || like == 'yes' ){
1574
- html += '<div class="instagram-like-comment">';
1575
- if( like == 'yes' ){
1576
- html += '<span class="like">'+like_icon+imgs[i].node.edge_liked_by.count+'</span>';
1577
- }
1578
- if( comment == 'yes' ){
1579
- html += '<span class="comment">'+comment_icon+imgs[i].node.edge_media_to_comment.count+'</span>';
1580
- }
1581
- html +='</div>';
1582
- }
1583
-
1584
- if( lightbox == 'yes' ){
1585
- html += '<div class="instagram-btn">';
1586
- html += '<a class="image-popup-vertical-fit" href="'+ fullimage +'">'+zoo_image+'</a>';
1587
- html += '</div>';
1588
- }
1589
-
1590
- html += '</div></div>';
1591
- }
1592
-
1593
-
1594
- html += '</li>';
1595
- }
1596
-
1597
- html += '</ul>';
1598
-
1599
- $( "#htmega-instagram-list-"+id ).html( html );
1600
- }
1601
-
1602
- // Instagram Feed
1603
- if( window.localStorage.getItem( "htmega_instragram_local_data_status"+id ) === 'true' ){
1604
- var localdata = window.localStorage.getItem( "htmega_instragram_local_data_"+id );
1605
- htMegaDisplayInstagramFeed( JSON.parse( localdata ) );
1606
- }else{
1607
- $.instagramFeed({
1608
- 'username': username,
1609
- 'callback': function( data ){
1610
- window.localStorage.setItem( "htmega_instragram_local_data_"+id, JSON.stringify( data ) );
1611
- window.localStorage.setItem( "htmega_instragram_local_data_status"+id, 'true' );
1612
- htMegaDisplayInstagramFeed( data );
1613
- }
1614
- });
1615
- }
1616
-
1617
- if( slider_on == 'yes' ){
1618
-
1619
- function htMegaInstagramSlider( selector = 'htmega-instagram-list' ){
1620
- $("#htmega-instagram-list-"+id+" ." + selector ).slick({
1621
- arrows: arrows,
1622
- prevArrow: '<button class="htmega-carosul-prev">'+arrow_prev_txt+'</button>',
1623
- nextArrow: '<button class="htmega-carosul-next">'+arrow_next_txt+'</button>',
1624
- dots: dots,
1625
- infinite: true,
1626
- autoplay: autoplay,
1627
- autoplaySpeed: autoplay_speed,
1628
- speed: animation_speed,
1629
- fade: false,
1630
- pauseOnHover: pause_on_hover,
1631
- slidesToShow: display_columns,
1632
- slidesToScroll: scroll_columns,
1633
- centerMode: center_mode,
1634
- centerPadding: center_padding,
1635
- responsive: [
1636
- {
1637
- breakpoint: tablet_width,
1638
- settings: {
1639
- slidesToShow: tablet_display_columns,
1640
- slidesToScroll: tablet_scroll_columns
1641
- }
1642
- },
1643
- {
1644
- breakpoint: mobile_width,
1645
- settings: {
1646
- slidesToShow: mobile_display_columns,
1647
- slidesToScroll: mobile_scroll_columns
1648
- }
1649
- }
1650
- ]
1651
- })
1652
- }
1653
-
1654
- if( window.localStorage.getItem( "htmega_instragram_local_data_status"+id ) === 'true' ){
1655
- htMegaInstagramSlider();
1656
- }else{
1657
- $("#htmega-instagram-list-"+id).on("DOMNodeInserted", function (e) {
1658
- if ( e.target.className == 'htmega-instagram-list' ) {
1659
- htMegaInstagramSlider();
1660
- }
1661
- });
1662
- }
1663
-
1664
- }
1665
-
1666
- });
1667
- </script>
1668
-
1669
  <?php
1670
  }
1671
 
1672
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
  public function get_script_depends() {
32
  return [
 
33
  'slick',
34
  'htmega-widgets-scripts',
35
  ];
56
  '3' => __( 'Style Three', 'htmega-addons' ),
57
  '4' => __( 'Style Four', 'htmega-addons' ),
58
  ],
 
59
  ]
60
  );
61
 
62
+ // $this->add_control(
63
+ // 'userid',
64
+ // [
65
+ // 'label' => __( 'Instagram user ID', 'htmega-addons' ),
66
+ // 'type' => Controls_Manager::TEXT,
67
+ // 'placeholder' => __( '6666969077', 'htmega-addons' ),
68
+ // 'label_block' =>true,
69
+ // 'description' => wp_kses_post( '(<a href="'.esc_url('https://codeofaninja.com/tools/find-instagram-user-id').'" target="_blank">Lookup your User ID</a>)', 'htmega-addons' ),
70
+ // ]
71
+ // );
72
+
73
  $this->add_control(
74
+ 'access_token',
75
  [
76
+ 'label' => __( 'Instagram Access Token', 'htmega-addons' ),
77
  'type' => Controls_Manager::TEXT,
 
78
  'label_block' =>true,
79
+ 'description' => wp_kses_post( '(<a href="'.esc_url('https://developers.facebook.com/docs/instagram-basic-display-api/getting-started').'" target="_blank">Lookup your Access Token</a>)', 'htmega-addons' ),
80
+ ]
81
+ );
82
+
83
+ $this->add_control(
84
+ 'delete_cache',
85
+ [
86
+ 'label' => __( 'Delete existing caching data', 'htmega-addons' ),
87
+ 'type' => Controls_Manager::SWITCHER,
88
+ 'separator' => 'before',
89
+ ]
90
+ );
91
+
92
+ $this->add_control(
93
+ 'cash_time_duration',
94
+ [
95
+ 'label' => __('Cache Time Duration', 'htmega-addons'),
96
+ 'type' => Controls_Manager::SELECT,
97
+ 'options' => [
98
+ 'minute' => __('Minute', 'htmega-addons'),
99
+ 'hour' => __('Hour', 'htmega-addons'),
100
+ 'day' => __('Day', 'htmega-addons'),
101
+ 'week' => __('Week', 'htmega-addons'),
102
+ 'month' => __('Month', 'htmega-addons'),
103
+ 'year' => __('Year', 'htmega-addons'),
104
+ ],
105
+ 'default' => 'day',
106
+ 'condition'=>[
107
+ 'delete_cache!'=>'yes',
108
+ ],
109
+ 'label_block'=>true,
110
  ]
111
  );
112
 
156
  );
157
 
158
  $this->add_control(
159
+ 'show_caption',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  [
161
+ 'label' => __( 'Show Caption', 'htmega-addons' ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  'type' => Controls_Manager::SWITCHER,
163
  'label_on' => __( 'Show', 'htmega-addons' ),
164
  'label_off' => __( 'Hide', 'htmega-addons' ),
168
  );
169
 
170
  $this->add_control(
171
+ 'show_light_box',
172
  [
173
+ 'label' => __( 'Show Light Box', 'htmega-addons' ),
174
  'type' => Controls_Manager::SWITCHER,
175
  'label_on' => __( 'Show', 'htmega-addons' ),
176
  'label_off' => __( 'Hide', 'htmega-addons' ),
180
  );
181
 
182
  $this->add_control(
183
+ 'show_flow_button',
184
  [
185
+ 'label' => __( 'Show Follow Button', 'htmega-addons' ),
186
  'type' => Controls_Manager::SWITCHER,
187
  'label_on' => __( 'Show', 'htmega-addons' ),
188
  'label_off' => __( 'Hide', 'htmega-addons' ),
192
  );
193
 
194
  $this->add_control(
195
+ 'flow_button_txt',
196
  [
197
+ 'label' => __( 'Follow button Aditional text', 'htmega-addons' ),
198
+ 'type' => Controls_Manager::TEXT,
199
+ 'default' => __( 'Follow @', 'htmega-addons' ),
200
+ 'condition'=>[
201
+ 'show_flow_button'=>'yes',
202
+ ],
203
+ 'label_block'=>true,
204
  ]
205
  );
206
 
231
  'icon' =>'fa fa-info',
232
  ]
233
  ],
234
+ 'default' =>'img',
235
  'condition' =>[
236
  'show_light_box' =>'yes',
237
  ],
241
  $this->add_control(
242
  'zoom_image',
243
  [
244
+ 'label' => __('Image','htmega-addons'),
245
  'type'=>Controls_Manager::MEDIA,
246
  'dynamic' => [
247
  'active' => true,
262
  'condition' => [
263
  'show_light_box' =>'yes',
264
  'zoomicon_type' => 'img',
 
 
 
 
 
265
  ]
266
  ]
267
  );
282
  ]
283
  );
284
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  $this->add_control(
286
  'flow_button_icon',
287
  [
297
  ]
298
  );
299
 
 
 
 
 
 
 
 
 
 
300
  $this->end_controls_section();
301
 
302
  // Slider setting
453
  ]
454
  );
455
 
456
+
457
  $this->add_control(
458
  'slanimation_speed',
459
  [
708
  [
709
  'label' => __( 'Overlay Color', 'htmega-addons' ),
710
  'type' => Controls_Manager::COLOR,
711
+ 'scheme' => [
712
+ 'type' => Scheme_Color::get_type(),
713
+ 'value' => Scheme_Color::COLOR_1,
714
+ ],
715
  'default' => 'rgba(0, 0, 0, 0.7)',
716
  'selectors' => [
717
  '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip::before' => 'background-color: {{VALUE}};',
725
  $this->start_controls_section(
726
  'htmega_instagram_icon_style_section',
727
  [
728
+ 'label' => __( 'Icon', 'htmega-addons' ),
729
  'tab' => Controls_Manager::TAB_STYLE,
730
  'condition' =>[
731
  'zoomicon_type'=>'icon',
767
  [
768
  'label' => __( 'Color', 'htmega-addons' ),
769
  'type' => Controls_Manager::COLOR,
770
+ 'scheme' => [
771
+ 'type' => Scheme_Color::get_type(),
772
+ 'value' => Scheme_Color::COLOR_1,
773
+ ],
774
  'default' => '#ffffff',
775
  'selectors' => [
776
  '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list .zoom_icon i' => 'color: {{VALUE}};',
825
 
826
  // Zoom icon Style
827
  $this->start_controls_section(
828
+ 'htmega_instagram_caption_style_section',
829
  [
830
+ 'label' => __( 'Caption', 'htmega-addons' ),
831
  'tab' => Controls_Manager::TAB_STYLE,
832
  ]
833
  );
854
  'size' => 16,
855
  ],
856
  'selectors' => [
857
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment p' => 'font-size: {{SIZE}}{{UNIT}};',
858
  ],
859
  ]
860
  );
864
  [
865
  'label' => __( 'Color', 'htmega-addons' ),
866
  'type' => Controls_Manager::COLOR,
 
867
  'selectors' => [
868
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment p' => 'color: {{VALUE}};',
869
  ],
870
  ]
871
  );
877
  'type' => Controls_Manager::DIMENSIONS,
878
  'size_units' => [ 'px', '%', 'em' ],
879
  'selectors' => [
880
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment p' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
881
  ],
882
  ]
883
  );
889
  'type' => Controls_Manager::DIMENSIONS,
890
  'size_units' => [ 'px', '%', 'em' ],
891
  'selectors' => [
892
+ '{{WRAPPER}} .htmega-instragram ul.htmega-instagram-list li .instagram-clip .htmega-content .instagram-like-comment p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
893
  ],
894
  ]
895
  );
896
 
897
  $this->end_controls_section(); // Zoom icon Style end
898
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
899
  // Style instagram arrow style start
900
  $this->start_controls_section(
901
  'htmega_instagram_arrow_style',
924
  [
925
  'label' => __( 'Color', 'htmega-addons' ),
926
  'type' => Controls_Manager::COLOR,
927
+ 'scheme' => [
928
+ 'type' => Scheme_Color::get_type(),
929
+ 'value' => Scheme_Color::COLOR_1,
930
+ ],
931
  'default' => '#ffffff',
932
  'selectors' => [
933
  '{{WRAPPER}} .htmega-instragram .slick-arrow' => 'color: {{VALUE}};',
1074
  [
1075
  'label' => __( 'Color', 'htmega-addons' ),
1076
  'type' => Controls_Manager::COLOR,
1077
+ 'scheme' => [
1078
+ 'type' => Scheme_Color::get_type(),
1079
+ 'value' => Scheme_Color::COLOR_1,
1080
+ ],
1081
  'default' => '#ffffff',
1082
  'selectors' => [
1083
  '{{WRAPPER}} .htmega-instragram .slick-arrow:hover' => 'color: {{VALUE}};',
1278
  }
1279
 
1280
  protected function render( $instance = [] ) {
 
1281
  $settings = $this->get_settings_for_display();
1282
  $id = $this->get_id();
1283
 
1284
  $this->add_render_attribute( 'htmega_instragram', 'class', 'htmega-instragram' );
1285
  $this->add_render_attribute( 'htmega_instragram', 'class', 'htmega-instragram-style-'.$settings['instagram_style'] );
 
1286
 
1287
+ $limit = !empty( $settings['limit'] ) ? $settings['limit'] : 8;
1288
+ $access_token = !empty( $settings['access_token'] ) ? $settings['access_token'] : '';
 
1289
 
1290
+ $cache_duration = $this->get_cacheing_duration( $settings['cash_time_duration'] );
1291
+ $transient_var = $id . '_' . $limit;
1292
+
1293
+ if( $settings['delete_cache'] === 'yes' ){
1294
+ delete_transient( $transient_var );
1295
+ $cache_duration = MINUTE_IN_SECONDS;
1296
+ }
1297
+
1298
+ if( empty( $access_token ) ){
1299
+ echo '<p>'.esc_html__('Please enter your access token.','htmega-addons').'</p>';
1300
+ return;
1301
+ }
1302
+
1303
+ if ( false === ( $items = get_transient( $transient_var ) ) ) {
1304
+
1305
+ $url = 'https://graph.instagram.com/me/media?fields=id,caption,media_type,media_url,permalink,thumbnail_url,timestamp,username&limit=200&access_token='.esc_html($access_token);
1306
+
1307
+ $instagram_data = wp_remote_retrieve_body( wp_remote_get( $url ) );
1308
+
1309
+ $instagram_data = json_decode( $instagram_data, true );
1310
 
1311
+ if ( ! is_wp_error( $instagram_data ) ) {
1312
+
1313
+ if ( isset( $instagram_data['error']['message'] ) ) {
1314
+ echo '<p>'.esc_html__('Incorrect access token specified.','ht-magazine').'</p>';
1315
+ }
1316
+
1317
+ $items = array();
1318
+ foreach ( $instagram_data['data'] as $data_item ) {
1319
+ $item['id'] = $data_item['id'];
1320
+ $item['media_type'] = $data_item['media_type'];
1321
+ $item['src'] = $data_item['media_url'];
1322
+ $item['username'] = $data_item['username'];
1323
+ $item['link'] = $data_item['permalink'];
1324
+ $item['timestamp'] = $data_item['timestamp'];
1325
+ $item['caption'] = !empty( $data_item['caption'] ) ? $data_item['caption'] : '';
1326
+ $items[] = $item;
1327
+ }
1328
+ set_transient( $transient_var, $items, 1 * $cache_duration );
1329
+ }
1330
+ }
1331
+
1332
+ $username = !empty( $items[0]['username'] ) ? $items[0]['username'] : '';
1333
+ $profile_link = !empty( $items[0]['username'] ) ? 'https://www.instagram.com/'.$items[0]['username'] : '#';
1334
+
1335
+ // Instagram Attribute
1336
+ $this->add_render_attribute( 'instagram_attr', 'class', 'htmega-instagram-list' );
1337
+ if( $settings['slider_on'] == 'yes' ){
1338
+ $this->add_render_attribute( 'instagram_attr', 'class', 'htmega-carousel-activation' );
1339
+
1340
  $slider_settings = [
1341
  'arrows' => ('yes' === $settings['slarrows']),
1342
  'arrow_prev_txt' => HTMega_Icon_manager::render_icon( $settings['slprevicon'], [ 'aria-hidden' => 'true' ] ),
1363
  ];
1364
 
1365
  $slider_settings = array_merge( $slider_settings, $slider_responsive_settings );
1366
+
1367
+ $this->add_render_attribute( 'instagram_attr', 'data-settings', wp_json_encode( $slider_settings ) );
1368
  }
1369
 
1370
  ?>
1371
  <div <?php echo $this->get_render_attribute_string('htmega_instragram'); ?> >
1372
 
1373
+ <ul <?php echo $this->get_render_attribute_string('instagram_attr'); ?>>
1374
+ <?php
1375
+ if ( isset( $items ) && !empty($items)):
1376
+ $countitem = 0;
1377
+ foreach ( $items as $item ):
1378
+ $countitem++;
1379
+ ?>
1380
+ <li>
1381
+ <a href="<?php echo esc_url( $item['link'] ); ?>">
1382
+ <img src="<?php echo esc_url( $item['src'] ); ?>" alt="<?php echo esc_attr__( $item['username'],'htmega-addons');?>">
1383
+ </a>
1384
+ <?php if( $settings['show_caption'] == 'yes' || $settings['show_light_box'] == 'yes' ): ?>
1385
+ <div class="instagram-clip">
1386
+ <div class="htmega-content">
1387
+ <?php if( $settings['show_caption'] == 'yes' && !empty( $item['caption'] ) ): ?>
1388
+ <div class="instagram-like-comment">
1389
+ <p><?php echo esc_html( $item['caption'] ); ?></p>
1390
+ </div>
1391
+ <?php endif; if( $settings['show_light_box'] == 'yes' ): ?>
1392
+ <div class="instagram-btn">
1393
+ <a class="image-popup-vertical-fit" href="<?php echo esc_url( $item['src'] ); ?>">
1394
+ <?php
1395
+ if( !empty( $settings['zoom_image'] ) && $settings['zoomicon_type'] == 'img' ){
1396
+ echo Group_Control_Image_Size::get_attachment_image_html( $settings, 'zoom_imagesize', 'zoom_image' );
1397
+ }else{
1398
+ echo sprintf('<span class="zoom_icon">%1$s</span>', HTMega_Icon_manager::render_icon( $settings['zoom_icon'], [ 'aria-hidden' => 'true' ] ) );
1399
+ }
1400
+ ?>
1401
+ </a>
1402
+ </div>
1403
+ <?php endif;?>
1404
+
1405
+ </div>
1406
+ </div>
1407
+ <?php endif;?>
1408
+ </li>
1409
+ <?php if( $countitem == $limit ){ break; } endforeach; endif; ?>
1410
+ </ul>
1411
  <?php
1412
  if( $settings['show_flow_button'] == 'yes' ):
1413
+ $btn_prefix_txt = !empty( $settings['flow_button_txt'] ) ? $settings['flow_button_txt'] : '';
1414
  ?>
1415
  <a class="instagram_follow_btn" href="<?php echo esc_url( $profile_link ); ?>" target="_blank">
1416
  <?php echo HTMega_Icon_manager::render_icon( $settings['flow_button_icon'], [ 'aria-hidden' => 'true' ] ); ?>
1417
+ <span><?php echo esc_html__( $btn_prefix_txt.' '.$username,'htmega-addons');?></span>
1418
  </a>
1419
  <?php endif; ?>
1420
 
1421
  </div>
1422
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1423
  <?php
1424
  }
1425
 
1426
+ protected function get_cacheing_duration( $duration ){
1427
+ switch ( $duration ) {
1428
+ case 'minute':
1429
+ $cache_duration = MINUTE_IN_SECONDS;
1430
+ break;
1431
+ case 'hour':
1432
+ $cache_duration = HOUR_IN_SECONDS;
1433
+ break;
1434
+ case 'day':
1435
+ $cache_duration = DAY_IN_SECONDS;
1436
+ break;
1437
+ case 'week':
1438
+ $cache_duration = WEEK_IN_SECONDS;
1439
+ break;
1440
+ case 'month':
1441
+ $cache_duration = MONTH_IN_SECONDS;
1442
+ break;
1443
+ case 'year':
1444
+ $cache_duration = YEAR_IN_SECONDS;
1445
+ break;
1446
+ default:
1447
+ $cache_duration = DAY_IN_SECONDS;
1448
+ }
1449
+ return $cache_duration;
1450
+ }
1451
+
1452
+
1453
+ }
1454
+
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: hasthemes, htplugins, devitemsllc, tarekht
3
  Tags: Elementor, Elementor Addons, Elementor Widgets, elementor page builder, Elementor Blocks
4
  Requires at least: 4.7
5
- Tested up to: 5.6
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -170,6 +170,9 @@ Feel free to [Contact us](https://htplugins.com/contact-us/)
170
  Visit [HasThemes](https://hasthemes.com/) for more details about HTML, Shopify and WordPress products and services.
171
 
172
  == Changelog ==
 
 
 
173
  = Version: 1.5.4 - Date: 2021-03-02 =
174
  * GoogleMap Console error issue solved.
175
 
2
  Contributors: hasthemes, htplugins, devitemsllc, tarekht
3
  Tags: Elementor, Elementor Addons, Elementor Widgets, elementor page builder, Elementor Blocks
4
  Requires at least: 4.7
5
+ Tested up to: 5.7
6
  Stable tag: trunk
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
170
  Visit [HasThemes](https://hasthemes.com/) for more details about HTML, Shopify and WordPress products and services.
171
 
172
  == Changelog ==
173
+ = Version: 1.5.5- Date: 2021-03-11 =
174
+ * Instagram issue solved.
175
+
176
  = Version: 1.5.4 - Date: 2021-03-02 =
177
  * GoogleMap Console error issue solved.
178