MetaSlider - Version 3.1.1

Version Description

[21/10/14] =

  • Fix: restrict_to shortcode parameter
  • Change: Add metaslider_flex_slider_list_item_attributes filter
Download this release

Release Info

Developer matchalabs
Plugin Icon 128x128 MetaSlider
Version 3.1.1
Comparing to
See all releases

Code changes from version 3.0.1 to 3.1.1

assets/metaslider/admin.css CHANGED
@@ -31,18 +31,6 @@
31
  box-shadow: inherit;
32
  }
33
 
34
- .media-frame-menu .media-menu > a.disabled {
35
- display: block;
36
- position: relative;
37
- padding: 4px 20px;
38
- margin: 0;
39
- line-height: 18px;
40
- font-size: 14px;
41
- color: #cccccc;
42
- text-shadow: 0 1px 0 #fff;
43
- text-decoration: none;
44
- }
45
-
46
  .attachment-filters {
47
  display: none
48
  }
@@ -160,62 +148,6 @@
160
  display: none
161
  }
162
 
163
- .metaslider_pro {
164
- margin-top: 50px;
165
- }
166
- .metaslider_pro p {
167
- text-align: center;
168
- font-size: 1.2em;
169
- }
170
-
171
- .metaslider_pro .probutton,
172
- .metaslider_pro .probutton:hover {
173
- width: 36%;
174
- margin: 20px 32% 10px 32%;
175
- float: left;
176
- font-size: 1.4em;
177
- padding: 15px 0;
178
- border-color: #3793B7;
179
- background-color: #41add7;
180
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #41add7), color-stop(100%, #218cb7));
181
- background-image: -webkit-linear-gradient(top, #41add7, #218cb7);
182
- background-image: -moz-linear-gradient(top, #41add7, #218cb7);
183
- background-image: -o-linear-gradient(top, #41add7, #218cb7);
184
- background-image: linear-gradient(top, #41add7, #218cb7);
185
- -webkit-box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.2);
186
- -moz-box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.2);
187
- box-shadow: inset 0 1px rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.2);
188
- border-radius: 4px;
189
- -webkit-box-shadow: inset 0 0 2px 0 rgba(57, 140, 255, 0.8);
190
- box-shadow: inset 0 0 2px 0 rgba(57, 140, 255, 0.8);
191
- color: #fff;
192
- font-family: 'PT Sans', helvetica, arial, sans-serif;
193
- text-shadow: 0 -1px 1px #1a5ad9;
194
- color: white;
195
- text-align: center;
196
- text-decoration: none;
197
- border-radius: 5px;
198
- line-height: 2em;
199
- }
200
-
201
- .metaslider_pro .super {
202
- text-transform: uppercase;
203
- font-size: 0.7em;
204
- vertical-align: top;
205
- line-height: 2em;
206
- }
207
-
208
- .metaslider_pro .subtext {
209
- float: left;
210
- width: 100%;
211
- text-align: center;
212
- font-style: italic;
213
- }
214
-
215
- .metaslider_pro .logo {
216
- text-transform: uppercase
217
- }
218
-
219
  .metaslider .tipsy-tooltip {
220
  cursor: default
221
  }
@@ -894,10 +826,32 @@ textarea:-ms-input-placeholder {
894
  color: #777;
895
  }
896
 
 
 
 
 
 
897
  #screen-meta-links #screen-options-switch-view-wrap a:after {
898
  content: '';
899
  }
900
-
901
  #screen-meta-links #screen-options-switch-view-wrap a:before {
902
  padding: 0px 8px 0 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
903
  }
31
  box-shadow: inherit;
32
  }
33
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  .attachment-filters {
35
  display: none
36
  }
148
  display: none
149
  }
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  .metaslider .tipsy-tooltip {
152
  cursor: default
153
  }
826
  color: #777;
827
  }
828
 
829
+ #screen-meta-links #screen-options-link-wrap a {
830
+ padding: 3px 6px;
831
+ }
832
+
833
+ #screen-meta-links #screen-options-link-wrap a:after,
834
  #screen-meta-links #screen-options-switch-view-wrap a:after {
835
  content: '';
836
  }
837
+ #screen-meta-links #screen-options-link-wrap a:before,
838
  #screen-meta-links #screen-options-switch-view-wrap a:before {
839
  padding: 0px 8px 0 0;
840
+ }
841
+
842
+ .metaslider_gopro li:before {
843
+ top: 4px;
844
+ font: 400 20px/1 dashicons;
845
+ speak: none;
846
+ display: inline-block;
847
+ position: relative;
848
+ -webkit-font-smoothing: antialiased;
849
+ -moz-osx-font-smoothing: grayscale;
850
+ text-decoration: none!important;
851
+ content: '\f147';
852
+ color: #03b0d8;
853
+ }
854
+
855
+ #adminmenu .toplevel_page_metaslider .wp-menu-image img {
856
+ opacity: 1;
857
  }
assets/metaslider/admin.js CHANGED
@@ -50,12 +50,6 @@ jQuery(document).ready(function($) {
50
  // Remove the Media Library tab (media_upload_tabs filter is broken in 3.6)
51
  jQuery(".media-menu a:contains('Media Library')").remove();
52
 
53
- if (!metaslider_pro_active) {
54
- jQuery(".media-menu a:contains('YouTube')").addClass('disabled');
55
- jQuery(".media-menu a:contains('Vimeo')").addClass('disabled');
56
- jQuery(".media-menu a:contains('Post Feed')").addClass('disabled');
57
- jQuery(".media-menu a:contains('Layer Slide')").addClass('disabled');
58
- }
59
  });
60
 
61
  jQuery("#screen-options-link-wrap").appendTo("#screen-meta-links").show();
@@ -184,10 +178,6 @@ jQuery(document).ready(function($) {
184
  jQuery(".metaslider input[type=submit]").removeAttr("disabled");
185
  });
186
 
187
- // show the confirm dialogue
188
- jQuery(".confirm").on("click", function() {
189
- return confirm(metaslider.confirm);
190
- });
191
 
192
  jQuery(".useWithCaution").on("change", function(){
193
  if(!this.checked) {
@@ -196,8 +186,8 @@ jQuery(document).ready(function($) {
196
  });
197
 
198
  // helptext tooltips
199
- jQuery(".metaslider .tipsy-tooltip").tipsy({className: 'msTipsy', live: true, delayIn: 500, html: true, gravity: 'e'});
200
- jQuery(".metaslider .tipsy-tooltip-top").tipsy({live: true, delayIn: 500, html: true, gravity: 'se'});
201
 
202
  // Select input field contents when clicked
203
  jQuery(".metaslider .shortcode input, .metaslider .shortcode textarea").on('click', function() {
@@ -256,6 +246,27 @@ jQuery(document).ready(function($) {
256
  tab.addClass("selected");
257
  });
258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  // AJAX save & preview
260
  jQuery(".metaslider form").find("input[type=submit]").on("click", function(e) {
261
  e.preventDefault();
50
  // Remove the Media Library tab (media_upload_tabs filter is broken in 3.6)
51
  jQuery(".media-menu a:contains('Media Library')").remove();
52
 
 
 
 
 
 
 
53
  });
54
 
55
  jQuery("#screen-options-link-wrap").appendTo("#screen-meta-links").show();
178
  jQuery(".metaslider input[type=submit]").removeAttr("disabled");
179
  });
180
 
 
 
 
 
181
 
182
  jQuery(".useWithCaution").on("change", function(){
183
  if(!this.checked) {
186
  });
187
 
188
  // helptext tooltips
189
+ jQuery(".tipsy-tooltip").tipsy({className: 'msTipsy', live: true, delayIn: 500, html: true, gravity: 'e'});
190
+ jQuery(".tipsy-tooltip-top").tipsy({live: true, delayIn: 500, html: true, gravity: 'se'});
191
 
192
  // Select input field contents when clicked
193
  jQuery(".metaslider .shortcode input, .metaslider .shortcode textarea").on('click', function() {
246
  tab.addClass("selected");
247
  });
248
 
249
+
250
+ // show the confirm dialogue
251
+ jQuery(".metaslider").on('click', '.delete-slider', function() {
252
+ return confirm(metaslider.confirm);
253
+ });
254
+
255
+ // delete a slide using ajax (avoid losing changes)
256
+ jQuery(".metaslider").on('click', '.delete-slide', function(e) {
257
+ e.preventDefault();
258
+
259
+ var link = jQuery(this);
260
+
261
+ if (confirm(metaslider.confirm)) {
262
+ jQuery.get( link.attr('href') , function( data ) {
263
+ link.closest('tr').fadeOut(400, function() {
264
+ jQuery(this).remove();
265
+ });
266
+ });
267
+ }
268
+ });
269
+
270
  // AJAX save & preview
271
  jQuery(".metaslider form").find("input[type=submit]").on("click", function(e) {
272
  e.preventDefault();
assets/metaslider/matchalabs.png CHANGED
Binary file
inc/slide/metaslide.class.php CHANGED
@@ -202,7 +202,7 @@ class MetaSlide {
202
  */
203
  public function get_delete_button_html() {
204
 
205
- return "<a class='delete-slide confirm' href='?page=metaslider&amp;id={$this->slider->ID}&amp;deleteSlide={$this->slide->ID}'>x</a>";
206
 
207
  }
208
 
202
  */
203
  public function get_delete_button_html() {
204
 
205
+ return "<a class='delete-slide' href='?page=metaslider&amp;id={$this->slider->ID}&amp;deleteSlide={$this->slide->ID}'>x</a>";
206
 
207
  }
208
 
inc/slide/metaslide.image.class.php CHANGED
@@ -354,9 +354,23 @@ class MetaImageSlide extends MetaSlide {
354
  $html .= '<div class="caption-wrap"><div class="caption">' . $slide['caption'] . '</div></div>';
355
  }
356
 
357
- $thumb = isset( $slide['data-thumb'] ) && strlen( $slide['data-thumb'] ) ? " data-thumb=\"{$slide['data-thumb']}\"" : "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
358
 
359
- $html = '<li style="display: none; width: 100%;"' . $thumb . '>' . $html . '</li>';
360
 
361
  return apply_filters( 'metaslider_image_flex_slider_markup', $html, $slide, $this->settings );
362
 
354
  $html .= '<div class="caption-wrap"><div class="caption">' . $slide['caption'] . '</div></div>';
355
  }
356
 
357
+ $attributes = apply_filters( 'metaslider_flex_slider_list_item_attributes', array(
358
+ 'data-thumb' => isset($slide['data-thumb']) ? $slide['data-thumb'] : "",
359
+ 'style' => "display: none; width: 100%;"
360
+ ), $slide, $this->slider->ID );
361
+
362
+ $li = "<li";
363
+
364
+ foreach ( $attributes as $att => $val ) {
365
+ if ( strlen( $val ) ) {
366
+ $li .= " " . $att . '="' . esc_attr( $val ) . '"';
367
+ }
368
+ }
369
+
370
+ $li .= ">" . $html . "</li>";
371
+
372
+ $html = $li;
373
 
 
374
 
375
  return apply_filters( 'metaslider_image_flex_slider_markup', $html, $slide, $this->settings );
376
 
ml-slider.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin Name: Meta Slider
6
  * Plugin URI: http://www.metaslider.com
7
  * Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
8
- * Version: 3.0.1
9
  * Author: Matcha Labs
10
  * Author URI: http://www.metaslider.com
11
  * License: GPL-2.0+
@@ -31,7 +31,7 @@ class MetaSliderPlugin {
31
  /**
32
  * @var string
33
  */
34
- public $version = '3.0.1';
35
 
36
 
37
  /**
@@ -167,13 +167,12 @@ class MetaSliderPlugin {
167
  add_action( 'init', array( $this, 'register_taxonomy' ) );
168
  add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
169
  add_action( 'admin_footer', array( $this, 'admin_footer' ), 11 );
170
- add_action( 'media_upload_vimeo', array( $this, 'upgrade_to_pro_tab' ) );
171
- add_action( 'media_upload_youtube', array( $this, 'upgrade_to_pro_tab' ) );
172
- add_action( 'media_upload_post_feed', array( $this, 'upgrade_to_pro_tab' ) );
173
- add_action( 'media_upload_layer', array( $this, 'upgrade_to_pro_tab' ) );
174
- add_action( 'admin_post_metaslider_preview', array( $this, 'do_preview' ) );
175
  add_action( 'widgets_init', array( $this, 'register_metaslider_widget' ) );
176
 
 
 
 
 
177
  if ( defined( 'METASLIDER_ENABLE_RESOURCE_MANAGER' ) && METASLIDER_ENABLE_RESOURCE_MANAGER === true ) {
178
 
179
  add_action( 'template_redirect', array( $this, 'start_resource_manager'), 0 );
@@ -262,6 +261,7 @@ class MetaSliderPlugin {
262
  * Add the menu page
263
  */
264
  public function register_admin_menu() {
 
265
 
266
  $title = apply_filters( 'metaslider_menu_title', 'Meta Slider' );
267
 
@@ -276,6 +276,73 @@ class MetaSliderPlugin {
276
  add_action( 'admin_print_styles-' . $page, array( $this, 'register_admin_styles' ) );
277
  add_action( 'load-' . $page, array( $this, 'help_tab' ) );
278
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  }
280
 
281
 
@@ -297,7 +364,11 @@ class MetaSliderPlugin {
297
  }
298
 
299
  // handle [metaslider id=123 restrict_to=home]
300
- if ( $restrict_to == 'home' && ! is_front_page() ) {
 
 
 
 
301
  return;
302
  }
303
 
@@ -481,31 +552,13 @@ class MetaSliderPlugin {
481
  */
482
  public function custom_media_upload_tab_name( $tabs ) {
483
 
484
- $metaslider_tabs = array( 'post_feed', 'layer', 'youtube', 'vimeo' );
485
-
486
  // restrict our tab changes to the meta slider plugin page
487
- if ( ( isset( $_GET['page'] ) && $_GET['page'] == 'metaslider' ) || ( isset( $_GET['tab'] ) && in_array( $_GET['tab'], $metaslider_tabs ) ) ) {
488
- $newtabs = array();
489
-
490
- if ( function_exists( 'is_plugin_active' ) && ! is_plugin_active( 'ml-slider-pro/ml-slider-pro.php' ) ) {
491
- $newtabs = array(
492
- 'post_feed' => __( "Post Feed", "metaslider" ),
493
- 'vimeo' => __( "Vimeo", "metaslider" ),
494
- 'youtube' => __( "YouTube", "metaslider" ),
495
- 'layer' => __( "Layer Slide", "metaslider" )
496
- );
497
- }
498
-
499
- if ( isset( $tabs['nextgen'] ) )
500
  unset( $tabs['nextgen'] );
501
-
502
-
503
- if ( is_array( $tabs ) ) {
504
- return array_merge( $tabs, $newtabs );
505
- } else {
506
- return $newtabs;
507
  }
508
-
509
  }
510
 
511
  return $tabs;
@@ -574,11 +627,6 @@ class MetaSliderPlugin {
574
  return;
575
  }
576
 
577
- // handle switching view
578
- if ( isset( $_GET['view'] ) ) {
579
- $this->switch_view();
580
- }
581
-
582
  // default to the latest slider
583
  $slider_id = $this->find_slider( 'modified', 'DESC' );
584
 
@@ -612,7 +660,7 @@ class MetaSliderPlugin {
612
  /**
613
  *
614
  */
615
- private function switch_view() {
616
  global $user_ID;
617
 
618
  $view = $_GET['view'];
@@ -629,6 +677,8 @@ class MetaSliderPlugin {
629
  add_user_meta( $user_ID, "metaslider_view", "dropdown");
630
  }
631
 
 
 
632
  }
633
 
634
  /**
@@ -959,7 +1009,8 @@ class MetaSliderPlugin {
959
 
960
  if ( $this->get_view() == 'tabs' ) {
961
 
962
- echo "<div style='display: none;' id='screen-options-switch-view-wrap'><a class='switchview dashicons-before dashicons-welcome-view-site' href='?page=metaslider&amp;view=dropdown'>" . __("Switch to Dropdown view", "metaslider") . "</a></div>";
 
963
 
964
  echo "<h3 class='nav-tab-wrapper'>";
965
 
@@ -984,7 +1035,7 @@ class MetaSliderPlugin {
984
 
985
  }
986
 
987
- echo "<div style='display: none;' id='screen-options-switch-view-wrap'><a class='switchview dashicons-before dashicons-welcome-view-site' href='?page=metaslider&amp;view=tabs'>" . __("Switch to Tab view", "metaslider") . "</a></div>";
988
 
989
  echo "<div class='dropdown_container'><label for='select-slider'>" . __("Select Slider", "metaslider") . ": </label>";
990
  echo "<select name='select-slider' onchange='if (this.value) window.location.href=this.value'>";
@@ -1047,7 +1098,6 @@ class MetaSliderPlugin {
1047
 
1048
  <script type='text/javascript'>
1049
  var metaslider_slider_id = <?php echo $slider_id; ?>;
1050
- var metaslider_pro_active = <?php echo function_exists( 'is_plugin_active' ) && is_plugin_active( 'ml-slider-pro/ml-slider-pro.php' ) ? 'true' : 'false' ?>;
1051
  </script>
1052
 
1053
  <div class="wrap metaslider">
@@ -1068,16 +1118,21 @@ class MetaSliderPlugin {
1068
 
1069
  <div id='post-body-content'>
1070
  <div class="left">
 
 
 
1071
  <table class="widefat sortable">
1072
  <thead>
1073
  <tr>
1074
  <th style="width: 100px;">
1075
  <h3><?php _e( "Slides", "metaslider" ) ?></h3>
 
1076
  </th>
1077
  <th>
1078
  <a href='#' class='button alignright add-slide' data-editor='content' title='<?php _e( "Add Slide", "metaslider" ) ?>'>
1079
  <span class='wp-media-buttons-icon'></span> <?php _e( "Add Slide", "metaslider" ) ?>
1080
  </a>
 
1081
  </th>
1082
  </tr>
1083
  </thead>
@@ -1088,467 +1143,473 @@ class MetaSliderPlugin {
1088
  ?>
1089
  </tbody>
1090
  </table>
 
 
 
1091
  </div>
1092
  </div>
1093
 
1094
  <div id="postbox-container-1" class="postbox-container">
1095
- <div id="side-sortables" class="meta-box-sortables">
1096
- <div class='right'>
1097
- <div class="ms-postbox" id="metaslider_configuration">
1098
- <h3 class='configuration'>
1099
- <?php _e( "Settings", "metaslider" ) ?>
1100
- <input class='alignright button button-primary' type='submit' name='save' id='ms-save' value='<?php _e( "Save", "metaslider" ) ?>' />
1101
- <input class='alignright button button-primary' type='submit' name='preview' id='ms-preview' value='<?php _e( "Save & Preview", "metaslider" ) ?>' data-slider_id='<?php echo $this->slider->id ?>' data-slider_width='<?php echo $this->slider->get_setting( 'width' ) ?>' data-slider_height='<?php echo $this->slider->get_setting( 'height' ) ?>' />
1102
- <span class="spinner"></span>
1103
- </h3>
1104
- <div class="inside">
1105
- <table class="settings">
1106
- <tbody>
1107
- <?php
1108
- $aFields = array(
1109
- 'type' => array(
1110
- 'priority' => 0,
1111
- 'type' => 'slider-lib',
1112
- 'value' => $this->slider->get_setting( 'type' ),
1113
- 'options' => array(
1114
- 'flex' => array( 'label' => __( "Flex Slider", "metaslider" ) ),
1115
- 'responsive' => array( 'label' => __( "R. Slides", "metaslider" ) ),
1116
- 'nivo' => array( 'label' => __( "Nivo Slider", "metaslider" ) ),
1117
- 'coin' => array( 'label' => __( "Coin Slider", "metaslider" ) )
1118
- )
1119
- ),
1120
- 'width' => array(
1121
- 'priority' => 10,
1122
- 'type' => 'number',
1123
- 'size' => 3,
1124
- 'min' => 0,
1125
- 'max' => 9999,
1126
- 'step' => 1,
1127
- 'value' => $this->slider->get_setting( 'width' ),
1128
- 'label' => __( "Width", "metaslider" ),
1129
- 'class' => 'coin flex responsive nivo',
1130
- 'helptext' => __( "Slideshow width", "metaslider" ),
1131
- 'after' => __( "px", "metaslider" )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1132
  ),
1133
- 'height' => array(
1134
- 'priority' => 20,
1135
- 'type' => 'number',
1136
- 'size' => 3,
1137
- 'min' => 0,
1138
- 'max' => 9999,
1139
- 'step' => 1,
1140
- 'value' => $this->slider->get_setting( 'height' ),
1141
- 'label' => __( "Height", "metaslider" ),
1142
- 'class' => 'coin flex responsive nivo',
1143
- 'helptext' => __( "Slideshow height", "metaslider" ),
1144
- 'after' => __( "px", "metaslider" )
1145
- ),
1146
- 'effect' => array(
1147
- 'priority' => 30,
1148
- 'type' => 'select',
1149
- 'value' => $this->slider->get_setting( 'effect' ),
1150
- 'label' => __( "Effect", "metaslider" ),
1151
- 'class' => 'effect coin flex responsive nivo',
1152
- 'helptext' => __( "Slide transition effect", "metaslider" ),
1153
- 'options' => array(
1154
- 'random' => array( 'class' => 'option coin nivo' , 'label' => __( "Random", "metaslider" ) ),
1155
- 'swirl' => array( 'class' => 'option coin', 'label' => __( "Swirl", "metaslider" ) ),
1156
- 'rain' => array( 'class' => 'option coin', 'label' => __( "Rain", "metaslider" ) ),
1157
- 'straight' => array( 'class' => 'option coin', 'label' => __( "Straight", "metaslider" ) ),
1158
- 'sliceDown' => array( 'class' => 'option nivo', 'label' => __( "Slide Down", "metaslider" ) ),
1159
- 'sliceUp' => array( 'class' => 'option nivo', 'label' => __( "Slice Up", "metaslider" ) ),
1160
- 'sliceUpLeft' => array( 'class' => 'option nivo', 'label' => __( "Slide Up Left", "metaslider" ) ),
1161
- 'sliceUpDown' => array( 'class' => 'option nivo', 'label' => __( "Slice Up Down", "metaslider" ) ),
1162
- 'slideUpDownLeft' => array( 'class' => 'option nivo', 'label' => __( "Slide Up Down Left", "metaslider" ) ),
1163
- 'fold' => array( 'class' => 'option nivo', 'label' => __( "Fold", "metaslider" ) ),
1164
- 'fade' => array( 'class' => 'option nivo flex responsive', 'label' => __( "Fade", "metaslider" ) ),
1165
- 'slideInRight' => array( 'class' => 'option nivo', 'label' => __( "Slide In Right", "metaslider" ) ),
1166
- 'slideInLeft' => array( 'class' => 'option nivo', 'label' => __( "Slide In Left", "metaslider" ) ),
1167
- 'boxRandom' => array( 'class' => 'option nivo', 'label' => __( "Box Random", "metaslider" ) ),
1168
- 'boxRain' => array( 'class' => 'option nivo', 'label' => __( "Box Rain", "metaslider" ) ),
1169
- 'boxRainReverse' => array( 'class' => 'option nivo', 'label' => __( "Box Rain Reverse", "metaslider" ) ),
1170
- 'boxRainGrowReverse' => array( 'class' => 'option nivo', 'label' => __( "Box Rain Grow Reverse", "metaslider" ) ),
1171
- 'slide' => array( 'class' => 'option flex', 'label' => __( "Slide", "metaslider" ) )
1172
- ),
1173
- ),
1174
- 'theme' => array(
1175
- 'priority' => 40,
1176
- 'type' => 'theme',
1177
- 'value' => $this->slider->get_setting( 'theme' ),
1178
- 'label' => __( "Theme", "metaslider" ),
1179
- 'class' => 'effect coin flex responsive nivo',
1180
- 'helptext' => __( "Slideshow theme", "metaslider" ),
1181
- 'options' => array(
1182
- 'default' => array( 'class' => 'option nivo flex coin responsive' , 'label' => __( "Default", "metaslider" ) ),
1183
- 'dark' => array( 'class' => 'option nivo', 'label' => __( "Dark (Nivo)", "metaslider" ) ),
1184
- 'light' => array( 'class' => 'option nivo', 'label' => __( "Light (Nivo)", "metaslider" ) ),
1185
- 'bar' => array( 'class' => 'option nivo', 'label' => __( "Bar (Nivo)", "metaslider" ) ),
1186
- ),
1187
- ),
1188
- 'links' => array(
1189
- 'priority' => 50,
1190
- 'type' => 'checkbox',
1191
- 'label' => __( "Arrows", "metaslider" ),
1192
- 'class' => 'option coin flex nivo responsive',
1193
- 'checked' => $this->slider->get_setting( 'links' ) == 'true' ? 'checked' : '',
1194
- 'helptext' => __( "Show the previous/next arrows", "metaslider" )
1195
- ),
1196
- 'navigation' => array(
1197
- 'priority' => 60,
1198
- 'type' => 'navigation',
1199
- 'label' => __( "Navigation", "metaslider" ),
1200
- 'class' => 'option coin flex nivo responsive',
1201
- 'value' => $this->slider->get_setting( 'navigation' ),
1202
- 'helptext' => __( "Show the slide navigation bullets", "metaslider" ),
1203
- 'options' => array(
1204
- 'false' => array( 'label' => __( "Hidden", "metaslider" ) ),
1205
- 'true' => array( 'label' => __( "Dots", "metaslider" ) ),
1206
- )
1207
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1208
  );
 
1209
 
1210
- if ( $this->get_view() == 'dropdown' ) {
1211
- $aFields['title'] = array(
1212
- 'type' => 'title',
1213
- 'priority' => 5,
1214
- 'class' => 'option flex nivo responsive coin',
1215
- 'value' => get_the_title($this->slider->id),
1216
- 'label' => __( "Title", "metaslider" ),
1217
- 'helptext' => __( "Slideshow title", "metaslider" )
1218
- );
1219
- }
1220
-
1221
- $aFields = apply_filters( 'metaslider_basic_settings', $aFields, $this->slider );
1222
-
1223
- echo $this->build_settings_rows( $aFields );
1224
- ?>
1225
- </tbody>
1226
- </table>
1227
- </div>
1228
  </div>
 
1229
 
1230
- <div class="ms-postbox ms-toggle closed" id="metaslider_advanced_settings">
1231
- <div class="handlediv" title="Click to toggle"><br></div><h3 class="hndle"><span><?php _e( "Advanced Settings", "metaslider" ) ?></span></h3>
1232
- <div class="inside">
1233
- <table>
1234
- <tbody>
1235
- <?php
1236
- $aFields = array(
1237
- 'fullWidth' => array(
1238
- 'priority' => 5,
1239
- 'type' => 'checkbox',
1240
- 'label' => __( "Stretch", "metaslider" ),
1241
- 'class' => 'option flex nivo responsive',
1242
- 'after' => __( "100% wide output", "metaslider" ),
1243
- 'checked' => $this->slider->get_setting( 'fullWidth' ) == 'true' ? 'checked' : '',
1244
- 'helptext' => __( "Stretch the slideshow output to fill it's parent container", "metaslider" )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1245
  ),
1246
- 'center' => array(
1247
- 'priority' => 10,
1248
- 'type' => 'checkbox',
1249
- 'label' => __( "Center align", "metaslider" ),
1250
- 'class' => 'option coin flex nivo responsive',
1251
- 'checked' => $this->slider->get_setting( 'center' ) == 'true' ? 'checked' : '',
1252
- 'helptext' => __( "Center align the slideshow", "metaslider" )
1253
- ),
1254
- 'autoPlay' => array(
1255
- 'priority' => 20,
1256
- 'type' => 'checkbox',
1257
- 'label' => __( "Auto play", "metaslider" ),
1258
- 'class' => 'option flex nivo responsive',
1259
- 'checked' => $this->slider->get_setting( 'autoPlay' ) == 'true' ? 'checked' : '',
1260
- 'helptext' => __( "Transition between slides automatically", "metaslider" )
1261
- ),
1262
- 'smartCrop' => array(
1263
- 'priority' => 30,
1264
- 'type' => 'select',
1265
- 'label' => __( "Image Crop", "metaslider" ),
1266
- 'class' => 'option coin flex nivo responsive',
1267
- 'value' => $this->slider->get_setting( 'smartCrop' ),
1268
- 'options' => array(
1269
- 'true' => array( 'label' => __( "Smart", "metaslider" ), 'class' => '' ),
1270
- 'false' => array( 'label' => __( "Standard", "metaslider" ), 'class' => '' ),
1271
- 'disabled' => array( 'label' => __( "Disabled", "metaslider" ), 'class' => '' ),
1272
- ),
1273
- 'helptext' => __( "Smart Crop ensures your responsive slides are cropped to a ratio that results in a consistent slideshow size", "metaslider" )
1274
- ),
1275
- 'carouselMode' => array(
1276
- 'priority' => 40,
1277
- 'type' => 'checkbox',
1278
- 'label' => __( "Carousel mode", "metaslider" ),
1279
- 'class' => 'option flex showNextWhenChecked',
1280
- 'checked' => $this->slider->get_setting( 'carouselMode' ) == 'true' ? 'checked' : '',
1281
- 'helptext' => __( "Display multiple slides at once. Slideshow output will be 100% wide.", "metaslider" )
1282
- ),
1283
- 'carouselMargin' => array(
1284
- 'priority' => 45,
1285
- 'min' => 0,
1286
- 'max' => 9999,
1287
- 'step' => 1,
1288
- 'type' => 'number',
1289
- 'label' => __( "Carousel margin", "metaslider" ),
1290
- 'class' => 'option flex',
1291
- 'value' => $this->slider->get_setting( 'carouselMargin' ),
1292
- 'helptext' => __( "Pixel margin between slides in carousel.", "metaslider" ),
1293
- 'after' => __( "px", "metaslider" )
1294
- ),
1295
- 'random' => array(
1296
- 'priority' => 50,
1297
- 'type' => 'checkbox',
1298
- 'label' => __( "Random", "metaslider" ),
1299
- 'class' => 'option coin flex nivo responsive',
1300
- 'checked' => $this->slider->get_setting( 'random' ) == 'true' ? 'checked' : '',
1301
- 'helptext' => __( "Randomise the order of the slides", "metaslider" )
1302
- ),
1303
- 'hoverPause' => array(
1304
- 'priority' => 60,
1305
- 'type' => 'checkbox',
1306
- 'label' => __( "Hover pause", "metaslider" ),
1307
- 'class' => 'option coin flex nivo responsive',
1308
- 'checked' => $this->slider->get_setting( 'hoverPause' ) == 'true' ? 'checked' : '',
1309
- 'helptext' => __( "Pause the slideshow when hovering over slider, then resume when no longer hovering.", "metaslider" )
1310
- ),
1311
- 'reverse' => array(
1312
- 'priority' => 70,
1313
- 'type' => 'checkbox',
1314
- 'label' => __( "Reverse", "metaslider" ),
1315
- 'class' => 'option flex',
1316
- 'checked' => $this->slider->get_setting( 'reverse' ) == 'true' ? 'checked' : '',
1317
- 'helptext' => __( "Reverse the animation direction", "metaslider" )
1318
- ),
1319
- 'delay' => array(
1320
- 'priority' => 80,
1321
- 'type' => 'number',
1322
- 'size' => 3,
1323
- 'min' => 500,
1324
- 'max' => 10000,
1325
- 'step' => 100,
1326
- 'value' => $this->slider->get_setting( 'delay' ),
1327
- 'label' => __( "Slide delay", "metaslider" ),
1328
- 'class' => 'option coin flex responsive nivo',
1329
- 'helptext' => __( "How long to display each slide, in milliseconds", "metaslider" ),
1330
- 'after' => __( "ms", "metaslider" )
1331
- ),
1332
- 'animationSpeed' => array(
1333
- 'priority' => 90,
1334
- 'type' => 'number',
1335
- 'size' => 3,
1336
- 'min' => 0,
1337
- 'max' => 2000,
1338
- 'step' => 100,
1339
- 'value' => $this->slider->get_setting( 'animationSpeed' ),
1340
- 'label' => __( "Animation speed", "metaslider" ),
1341
- 'class' => 'option flex responsive nivo',
1342
- 'helptext' => __( "Set the speed of animations, in milliseconds", "metaslider" ),
1343
- 'after' => __( "ms", "metaslider" )
1344
- ),
1345
- 'slices' => array(
1346
- 'priority' => 100,
1347
- 'type' => 'number',
1348
- 'size' => 3,
1349
- 'min' => 0,
1350
- 'max' => 20,
1351
- 'step' => 1,
1352
- 'value' => $this->slider->get_setting( 'slices' ),
1353
- 'label' => __( "Number of slices", "metaslider" ),
1354
- 'class' => 'option nivo',
1355
- 'helptext' => __( "Number of slices", "metaslider" ),
1356
- 'after' => __( "ms", "metaslider" )
1357
- ),
1358
- 'spw' => array(
1359
- 'priority' => 110,
1360
- 'type' => 'number',
1361
- 'size' => 3,
1362
- 'min' => 0,
1363
- 'max' => 20,
1364
- 'step' => 1,
1365
- 'value' => $this->slider->get_setting( 'spw' ),
1366
- 'label' => __( "Number of squares", "metaslider" ) . " (" . __( "Width", "metaslider" ) . ")",
1367
- 'class' => 'option nivo',
1368
- 'helptext' => __( "Number of squares", "metaslider" ),
1369
- 'after' => ''
1370
- ),
1371
- 'sph' => array(
1372
- 'priority' => 120,
1373
- 'type' => 'number',
1374
- 'size' => 3,
1375
- 'min' => 0,
1376
- 'max' => 20,
1377
- 'step' => 1,
1378
- 'value' => $this->slider->get_setting( 'sph' ),
1379
- 'label' => __( "Number of squares", "metaslider" ) . " (" . __( "Height", "metaslider" ) . ")",
1380
- 'class' => 'option nivo',
1381
- 'helptext' => __( "Number of squares", "metaslider" ),
1382
- 'after' => ''
1383
- ),
1384
- 'direction' => array(
1385
- 'priority' => 130,
1386
- 'type' => 'select',
1387
- 'label' => __( "Slide direction", "metaslider" ),
1388
- 'class' => 'option flex',
1389
- 'helptext' => __( "Select the sliding direction", "metaslider" ),
1390
- 'value' => $this->slider->get_setting( 'direction' ),
1391
- 'options' => array(
1392
- 'horizontal' => array( 'label' => __( "Horizontal", "metaslider" ), 'class' => '' ),
1393
- 'vertical' => array( 'label' => __( "Vertical", "metaslider" ), 'class' => '' ),
1394
- )
1395
- ),
1396
- 'easing' => array(
1397
- 'priority' => 140,
1398
- 'type' => 'select',
1399
- 'label' => __( "Easing", "metaslider" ),
1400
- 'class' => 'option flex',
1401
- 'helptext' => __( "Animation easing effect", "metaslider" ),
1402
- 'value' => $this->slider->get_setting( 'easing' ),
1403
- 'options' => $this->get_easing_options()
1404
- ),
1405
- 'prevText' => array(
1406
- 'priority' => 150,
1407
- 'type' => 'text',
1408
- 'label' => __( "Previous text", "metaslider" ),
1409
- 'class' => 'option coin flex responsive nivo',
1410
- 'helptext' => __( "Set the text for the 'previous' direction item", "metaslider" ),
1411
- 'value' => $this->slider->get_setting( 'prevText' ) == 'false' ? '' : $this->slider->get_setting( 'prevText' )
1412
- ),
1413
- 'nextText' => array(
1414
- 'priority' => 160,
1415
- 'type' => 'text',
1416
- 'label' => __( "Next text", "metaslider" ),
1417
- 'class' => 'option coin flex responsive nivo',
1418
- 'helptext' => __( "Set the text for the 'next' direction item", "metaslider" ),
1419
- 'value' => $this->slider->get_setting( 'nextText' ) == 'false' ? '' : $this->slider->get_setting( 'nextText' )
1420
- ),
1421
- 'sDelay' => array(
1422
- 'priority' => 170,
1423
- 'type' => 'number',
1424
- 'size' => 3,
1425
- 'min' => 0,
1426
- 'max' => 500,
1427
- 'step' => 10,
1428
- 'value' => $this->slider->get_setting( 'sDelay' ),
1429
- 'label' => __( "Square delay", "metaslider" ),
1430
- 'class' => 'option coin',
1431
- 'helptext' => __( "Delay between squares in ms", "metaslider" ),
1432
- 'after' => __( "ms", "metaslider" )
1433
- ),
1434
- 'opacity' => array(
1435
- 'priority' => 180,
1436
- 'type' => 'number',
1437
- 'size' => 3,
1438
- 'min' => 0,
1439
- 'max' => 1,
1440
- 'step' => 0.1,
1441
- 'value' => $this->slider->get_setting( 'opacity' ),
1442
- 'label' => __( "Opacity", "metaslider" ),
1443
- 'class' => 'option coin',
1444
- 'helptext' => __( "Opacity of title and navigation", "metaslider" ),
1445
- 'after' => ''
1446
- ),
1447
- 'titleSpeed' => array(
1448
- 'priority' => 190,
1449
- 'type' => 'number',
1450
- 'size' => 3,
1451
- 'min' => 0,
1452
- 'max' => 10000,
1453
- 'step' => 100,
1454
- 'value' => $this->slider->get_setting( 'titleSpeed' ),
1455
- 'label' => __( "Caption speed", "metaslider" ),
1456
- 'class' => 'option coin',
1457
- 'helptext' => __( "Set the fade in speed of the caption", "metaslider" ),
1458
- 'after' => __( "ms", "metaslider" )
1459
- ),
1460
- 'developerOptions' => array(
1461
- 'priority' => 195,
1462
- 'type' => 'divider',
1463
- 'class' => 'option coin flex responsive nivo',
1464
- 'value' => __( "Developer options", "metaslider" )
1465
- ),
1466
- 'cssClass' => array(
1467
- 'priority' => 200,
1468
- 'type' => 'text',
1469
- 'label' => __( "CSS classes", "metaslider" ),
1470
- 'class' => 'option coin flex responsive nivo',
1471
- 'helptext' => __( "Specify any custom CSS Classes you would like to be added to the slider wrapper", "metaslider" ),
1472
- 'value' => $this->slider->get_setting( 'cssClass' ) == 'false' ? '' : $this->slider->get_setting( 'cssClass' )
1473
- ),
1474
- 'printCss' => array(
1475
- 'priority' => 210,
1476
- 'type' => 'checkbox',
1477
- 'label' => __( "Print CSS", "metaslider" ),
1478
- 'class' => 'option coin flex responsive nivo useWithCaution',
1479
- 'checked' => $this->slider->get_setting( 'printCss' ) == 'true' ? 'checked' : '',
1480
- 'helptext' => __( "Uncheck this is you would like to include your own CSS", "metaslider" )
1481
- ),
1482
- 'printJs' => array(
1483
- 'priority' => 220,
1484
- 'type' => 'checkbox',
1485
- 'label' => __( "Print JS", "metaslider" ),
1486
- 'class' => 'option coin flex responsive nivo useWithCaution',
1487
- 'checked' => $this->slider->get_setting( 'printJs' ) == 'true' ? 'checked' : '',
1488
- 'helptext' => __( "Uncheck this is you would like to include your own Javascript", "metaslider" )
1489
- ),
1490
- 'noConflict' => array(
1491
- 'priority' => 230,
1492
- 'type' => 'checkbox',
1493
- 'label' => __( "No conflict mode", "metaslider" ),
1494
- 'class' => 'option flex',
1495
- 'checked' => $this->slider->get_setting( 'noConflict' ) == 'true' ? 'checked' : '',
1496
- 'helptext' => __( "Delay adding the flexslider class to the slideshow", "metaslider" )
1497
- ),
1498
- );
1499
-
1500
- $aFields = apply_filters( 'metaslider_advanced_settings', $aFields, $this->slider );
1501
-
1502
- echo $this->build_settings_rows( $aFields );
1503
- ?>
1504
- </tbody>
1505
- </table>
1506
- </div>
1507
  </div>
 
1508
 
1509
- <div class="ms-postbox shortcode ms-toggle" id="metaslider_usage">
1510
- <div class="handlediv" title="Click to toggle"><br></div><h3 class="hndle"><span><?php _e( "Usage", "metaslider" ) ?></span></h3>
1511
- <div class="inside">
1512
- <ul class='tabs'>
1513
- <li rel='tab-1' class='selected'><?php _e( "Shortcode", "metaslider" ) ?></li>
1514
- <li rel='tab-2'><?php _e( "Template Include", "metaslider" ) ?></li>
1515
- </ul>
1516
- <div class='tabs-content'>
1517
- <div class='tab tab-1'>
1518
- <p><?php _e( "Copy & paste the shortcode directly into any WordPress post or page.", "metaslider" ); ?></p>
1519
- <input readonly='readonly' type='text' value='[metaslider id=<?php echo $this->slider->id ?>]' /></div>
1520
- <div class='tab tab-2' style='display: none'>
1521
- <p><?php _e( "Copy & paste this code into a template file to include the slideshow within your theme.", "metaslider" ); ?></p>
1522
- <textarea readonly='readonly'>&lt;?php &#13;&#10; echo do_shortcode("[metaslider id=<?php echo $this->slider->id ?>]"); &#13;&#10;?></textarea></div>
1523
- </div>
1524
  </div>
1525
  </div>
 
1526
 
1527
- <div class="ms-postbox social" id="metaslider_social">
1528
- <div class="inside">
1529
- <ul class='info'>
1530
- <li style='width: 33%;'>
1531
- <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.metaslider.com" data-text="Check out Meta Slider, an easy to use slideshow plugin for WordPress" data-hashtags="metaslider, wordpress, slideshow">Tweet</a>
1532
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
1533
- </li>
1534
- <li style='width: 34%;'>
1535
- <div class="g-plusone" data-size="medium" data-href="http://www.metaslider.com"></div>
1536
- <script type="text/javascript">
1537
- (function() {
1538
- var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
1539
- po.src = 'https://apis.google.com/js/plusone.js';
1540
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
1541
- })();
1542
- </script>
1543
- </li>
1544
- <li style='width: 33%;'>
1545
- <iframe style='border:none; overflow:hidden; width:80px; height:21px;' src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.metaslider.com&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21&amp;appId=156668027835524" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
1546
- </li>
1547
- </ul>
1548
- </div>
 
1549
  </div>
1550
- <a class='delete-slider alignright button-secondary confirm' href='<?php echo wp_nonce_url( "?page=metaslider&amp;delete={$this->slider->id}", "metaslider_delete_slider" ); ?>'><?php _e( "Delete Slider", "metaslider" ) ?></a>
1551
  </div>
 
 
 
 
1552
  </div>
1553
  </div>
1554
  </div>
@@ -1639,58 +1700,25 @@ class MetaSliderPlugin {
1639
  }
1640
 
1641
 
1642
- /**
1643
- * Return the meta slider pro upgrade iFrame
1644
- */
1645
- public function upgrade_to_pro_tab() {
1646
-
1647
- if ( function_exists( 'is_plugin_active' ) && ! is_plugin_active( 'ml-slider-pro/ml-slider-pro.php' ) ) {
1648
- return wp_iframe( array( $this, 'upgrade_to_pro_iframe' ) );
1649
- }
1650
-
1651
- }
1652
-
1653
-
1654
- /**
1655
- * Media Manager iframe HTML
1656
- */
1657
- public function upgrade_to_pro_iframe() {
1658
-
1659
- wp_enqueue_style( 'metaslider-admin-styles', METASLIDER_ASSETS_URL . 'metaslider/admin.css', false, METASLIDER_VERSION );
1660
- wp_enqueue_script( 'google-font-api', 'http://fonts.googleapis.com/css?family=PT+Sans:400,700' );
1661
-
1662
- $link = apply_filters( 'metaslider_hoplink', 'http://www.metaslider.com/upgrade/' );
1663
- $link .= '?utm_source=lite&amp;utm_medium=more-slide-types&amp;utm_campaign=pro';
1664
-
1665
- echo implode("", array(
1666
- "<div class='metaslider_pro'>",
1667
- "<p>Get the Pro Addon pack to add support for: <b>Post Feed</b> Slides, <b>YouTube</b> Slides, <b>HTML</b> Slides & <b>Vimeo</b> Slides</p>",
1668
- "<p><b>NEW: </b> Animated HTML <b>Layer</b> Slides (with an awesome Drag & Drop editor!)</p>",
1669
- "<p><b></b> Live Theme Editor!</p>",
1670
- "<p><b>NEW:</b> Thumbnail Navigation for Flex & Nivo Slider!</p>",
1671
- "<a class='probutton' href='{$link}' target='_blank'>Get <span class='logo'><strong>Meta</strong>Slider</span><span class='super'>Pro</span></a>",
1672
- "<span class='subtext'>Opens in a new window</span>",
1673
- "</div>"
1674
- ));
1675
-
1676
- }
1677
-
1678
-
1679
  /**
1680
  * Upgrade CTA.
1681
  */
1682
  public function upgrade_to_pro_cta() {
 
1683
 
1684
  if ( function_exists( 'is_plugin_active' ) && ! is_plugin_active( 'ml-slider-pro/ml-slider-pro.php' ) ) {
1685
  $link = apply_filters( 'metaslider_hoplink', 'http://www.metaslider.com/upgrade/' );
1686
 
1687
  $link .= '?utm_source=lite&amp;utm_medium=nag&amp;utm_campaign=pro';
1688
 
1689
- $goPro = "<div style='display: none;' id='screen-options-link-wrap'><a target='_blank' class='show-settings' href='{$link}'>Meta Slider v" . METASLIDER_VERSION . " - " .
1690
- __( 'Upgrade to Pro $19', "metaslider" ) .
1691
- "</a></div>";
 
 
 
 
1692
 
1693
- echo $goPro;
1694
  }
1695
 
1696
  }
5
  * Plugin Name: Meta Slider
6
  * Plugin URI: http://www.metaslider.com
7
  * Description: Easy to use slideshow plugin. Create SEO optimised responsive slideshows with Nivo Slider, Flex Slider, Coin Slider and Responsive Slides.
8
+ * Version: 3.1.1
9
  * Author: Matcha Labs
10
  * Author URI: http://www.metaslider.com
11
  * License: GPL-2.0+
31
  /**
32
  * @var string
33
  */
34
+ public $version = '3.1.1';
35
 
36
 
37
  /**
167
  add_action( 'init', array( $this, 'register_taxonomy' ) );
168
  add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
169
  add_action( 'admin_footer', array( $this, 'admin_footer' ), 11 );
 
 
 
 
 
170
  add_action( 'widgets_init', array( $this, 'register_metaslider_widget' ) );
171
 
172
+ add_action( 'admin_post_metaslider_preview', array( $this, 'do_preview' ) );
173
+ add_action( 'admin_post_metaslider_hide_go_pro_page', array( $this, 'hide_go_pro_page' ) );
174
+ add_action( 'admin_post_metaslider_switch_view', array( $this, 'switch_view' ) );
175
+
176
  if ( defined( 'METASLIDER_ENABLE_RESOURCE_MANAGER' ) && METASLIDER_ENABLE_RESOURCE_MANAGER === true ) {
177
 
178
  add_action( 'template_redirect', array( $this, 'start_resource_manager'), 0 );
261
  * Add the menu page
262
  */
263
  public function register_admin_menu() {
264
+ global $user_ID;
265
 
266
  $title = apply_filters( 'metaslider_menu_title', 'Meta Slider' );
267
 
276
  add_action( 'admin_print_styles-' . $page, array( $this, 'register_admin_styles' ) );
277
  add_action( 'load-' . $page, array( $this, 'help_tab' ) );
278
 
279
+ if ( ! is_plugin_active( 'ml-slider-pro/ml-slider-pro.php' ) && get_user_meta( $user_ID, "metaslider_hide_go_pro", true ) !== 'true' ) {
280
+
281
+ $page = add_submenu_page(
282
+ 'metaslider',
283
+ __( 'Go Pro!', 'metaslider' ),
284
+ __( 'Go Pro!', 'metaslider' ),
285
+ $capability,
286
+ 'metaslider-go-pro',
287
+ array( $this, 'go_pro_page' )
288
+ );
289
+
290
+ add_action( 'admin_print_styles-' . $page, array( $this, 'register_admin_styles' ) );
291
+
292
+ }
293
+
294
+ }
295
+
296
+ /**
297
+ * Go Pro page content
298
+ */
299
+ public function go_pro_page() {
300
+ $hide_link = '<a href="' . admin_url( "admin-post.php?action=metaslider_hide_go_pro_page" ) . '">Hide this page</a>';
301
+
302
+ $link = apply_filters( 'metaslider_hoplink', 'http://www.metaslider.com/upgrade/' );
303
+
304
+ $link .= '?utm_source=lite&amp;utm_medium=nag&amp;utm_campaign=pro';
305
+
306
+ $gopro_link = "<a class='button button-primary' href='{$link}'>Find out more</a>";
307
+ $support_link = '<a href="https://wordpress.org/support/plugin/ml-slider">Support</a>';
308
+ $documentation_link = '<a href="http://www.metaslider.com/documentation/">Documentation</a>';
309
+
310
+ ?>
311
+ <h2>Supercharge Your Sliders with Meta Slider Pro!</h2>
312
+
313
+ <ul class='metaslider_gopro'>
314
+ <li>Create <b>animated HTML slides</b> using the drag &amp; drop layer editor (WYSIWYG)</li>
315
+ <li>Insert <b>YouTube</b> and <b>Vimeo</b> videos into your slideshows</li>
316
+ <li>Automatically populate your slideshows with your <b>latest blog posts</b> or custom post types</li>
317
+ <li>Customize the look of your slideshows with the <b>Theme Editor</b> (25+ settings including custom arrow images, dot colors and caption styling)</li>
318
+ <li>Give your slideshows a gallery feel with <b>thumbnail navigation</b></li>
319
+ <li>Feature <b>WooCommerce</b> products in your slideshows</li>
320
+ <li>Show your latest events from <b>The Events Calendar</b> plugin</li>
321
+ <li><b>Easy to install</B> - Meta Slider Pro installs as a seperate plugin alongside Meta Slider and seamlessly adds in the new functionality</li>
322
+ <li><b>Easy to update</b> - new updates will be displayed on your plugins page (just like your other plugins!)</li>
323
+ <li>Upgrade with confidence with our <b>30 day no questions money back guarantee</b></li>
324
+ <li>Meta Slider Pro users receive <b>priority support</b> from our dedicated team, we’re on hand to help you get the most of Meta Slider</li>
325
+ </ul>
326
+
327
+ <p><?php echo $gopro_link; ?></p>
328
+ <p><?php echo $support_link; ?> <?php echo $documentation_link; ?></p>
329
+ <p><em>Don't want to see this? <?php echo $hide_link; ?></em></p>
330
+ <?php
331
+
332
+ }
333
+
334
+ /**
335
+ * Store the users preference to hide the go pro page.
336
+ */
337
+ public function hide_go_pro_page() {
338
+ global $user_ID;
339
+
340
+ if ( ! get_user_meta( $user_ID, "metaslider_hide_go_pro" ) ) {
341
+ add_user_meta( $user_ID, "metaslider_hide_go_pro", "true" );
342
+ }
343
+
344
+ wp_redirect( admin_url( "admin.php?page=metaslider" ) );
345
+
346
  }
347
 
348
 
364
  }
365
 
366
  // handle [metaslider id=123 restrict_to=home]
367
+ if ($restrict_to && $restrict_to == 'home' && ! is_front_page()) {
368
+ return;
369
+ }
370
+
371
+ if ($restrict_to && $restrict_to != 'home' && ! is_page( $restrict_to ) ) {
372
  return;
373
  }
374
 
552
  */
553
  public function custom_media_upload_tab_name( $tabs ) {
554
 
 
 
555
  // restrict our tab changes to the meta slider plugin page
556
+ if ( isset( $_GET['page'] ) && $_GET['page'] == 'metaslider' ) {
557
+
558
+ if ( isset( $tabs['nextgen'] ) ) {
 
 
 
 
 
 
 
 
 
 
559
  unset( $tabs['nextgen'] );
 
 
 
 
 
 
560
  }
561
+
562
  }
563
 
564
  return $tabs;
627
  return;
628
  }
629
 
 
 
 
 
 
630
  // default to the latest slider
631
  $slider_id = $this->find_slider( 'modified', 'DESC' );
632
 
660
  /**
661
  *
662
  */
663
+ public function switch_view() {
664
  global $user_ID;
665
 
666
  $view = $_GET['view'];
677
  add_user_meta( $user_ID, "metaslider_view", "dropdown");
678
  }
679
 
680
+ wp_redirect( admin_url( "admin.php?page=metaslider" ) );
681
+
682
  }
683
 
684
  /**
1009
 
1010
  if ( $this->get_view() == 'tabs' ) {
1011
 
1012
+ echo "<div style='display: none;' id='screen-options-switch-view-wrap'>
1013
+ <a class='switchview dashicons-before dashicons-randomize tipsy-tooltip' title='" . __("Switch to Dropdown view", "metaslider") . "' href='" . admin_url( "admin-post.php?action=metaslider_switch_view&view=dropdown") . "'>" . __("Dropdown", "metaslider") . "</a></div>";
1014
 
1015
  echo "<h3 class='nav-tab-wrapper'>";
1016
 
1035
 
1036
  }
1037
 
1038
+ echo "<div style='display: none;' id='screen-options-switch-view-wrap'><a class='switchview dashicons-before dashicons-randomize tipsy-tooltip' title='" . __("Switch to Tab view", "metaslider") . "' href='" . admin_url( "admin-post.php?action=metaslider_switch_view&view=tabs") . "'>" . __("Tabs", "metaslider") . "</a></div>";
1039
 
1040
  echo "<div class='dropdown_container'><label for='select-slider'>" . __("Select Slider", "metaslider") . ": </label>";
1041
  echo "<select name='select-slider' onchange='if (this.value) window.location.href=this.value'>";
1098
 
1099
  <script type='text/javascript'>
1100
  var metaslider_slider_id = <?php echo $slider_id; ?>;
 
1101
  </script>
1102
 
1103
  <div class="wrap metaslider">
1118
 
1119
  <div id='post-body-content'>
1120
  <div class="left">
1121
+
1122
+ <?php do_action( "metaslider_admin_table_before", $this->slider->id ); ?>
1123
+
1124
  <table class="widefat sortable">
1125
  <thead>
1126
  <tr>
1127
  <th style="width: 100px;">
1128
  <h3><?php _e( "Slides", "metaslider" ) ?></h3>
1129
+ <?php do_action( "metaslider_admin_table_header_left", $this->slider->id ); ?>
1130
  </th>
1131
  <th>
1132
  <a href='#' class='button alignright add-slide' data-editor='content' title='<?php _e( "Add Slide", "metaslider" ) ?>'>
1133
  <span class='wp-media-buttons-icon'></span> <?php _e( "Add Slide", "metaslider" ) ?>
1134
  </a>
1135
+ <?php do_action( "metaslider_admin_table_header_right", $this->slider->id ); ?>
1136
  </th>
1137
  </tr>
1138
  </thead>
1143
  ?>
1144
  </tbody>
1145
  </table>
1146
+
1147
+ <?php do_action( "metaslider_admin_table_after", $this->slider->id ); ?>
1148
+
1149
  </div>
1150
  </div>
1151
 
1152
  <div id="postbox-container-1" class="postbox-container">
1153
+ <div class='right'>
1154
+ <div class="ms-postbox" id="metaslider_configuration">
1155
+ <h3 class='configuration'>
1156
+ <?php _e( "Settings", "metaslider" ) ?>
1157
+ <input class='alignright button button-primary' type='submit' name='save' id='ms-save' value='<?php _e( "Save", "metaslider" ) ?>' />
1158
+ <input class='alignright button button-primary' type='submit' name='preview' id='ms-preview' value='<?php _e( "Save & Preview", "metaslider" ) ?>' data-slider_id='<?php echo $this->slider->id ?>' data-slider_width='<?php echo $this->slider->get_setting( 'width' ) ?>' data-slider_height='<?php echo $this->slider->get_setting( 'height' ) ?>' />
1159
+ <span class="spinner"></span>
1160
+ </h3>
1161
+ <div class="inside">
1162
+ <table class="settings">
1163
+ <tbody>
1164
+ <?php
1165
+ $aFields = array(
1166
+ 'type' => array(
1167
+ 'priority' => 0,
1168
+ 'type' => 'slider-lib',
1169
+ 'value' => $this->slider->get_setting( 'type' ),
1170
+ 'options' => array(
1171
+ 'flex' => array( 'label' => __( "Flex Slider", "metaslider" ) ),
1172
+ 'responsive' => array( 'label' => __( "R. Slides", "metaslider" ) ),
1173
+ 'nivo' => array( 'label' => __( "Nivo Slider", "metaslider" ) ),
1174
+ 'coin' => array( 'label' => __( "Coin Slider", "metaslider" ) )
1175
+ )
1176
+ ),
1177
+ 'width' => array(
1178
+ 'priority' => 10,
1179
+ 'type' => 'number',
1180
+ 'size' => 3,
1181
+ 'min' => 0,
1182
+ 'max' => 9999,
1183
+ 'step' => 1,
1184
+ 'value' => $this->slider->get_setting( 'width' ),
1185
+ 'label' => __( "Width", "metaslider" ),
1186
+ 'class' => 'coin flex responsive nivo',
1187
+ 'helptext' => __( "Slideshow width", "metaslider" ),
1188
+ 'after' => __( "px", "metaslider" )
1189
+ ),
1190
+ 'height' => array(
1191
+ 'priority' => 20,
1192
+ 'type' => 'number',
1193
+ 'size' => 3,
1194
+ 'min' => 0,
1195
+ 'max' => 9999,
1196
+ 'step' => 1,
1197
+ 'value' => $this->slider->get_setting( 'height' ),
1198
+ 'label' => __( "Height", "metaslider" ),
1199
+ 'class' => 'coin flex responsive nivo',
1200
+ 'helptext' => __( "Slideshow height", "metaslider" ),
1201
+ 'after' => __( "px", "metaslider" )
1202
+ ),
1203
+ 'effect' => array(
1204
+ 'priority' => 30,
1205
+ 'type' => 'select',
1206
+ 'value' => $this->slider->get_setting( 'effect' ),
1207
+ 'label' => __( "Effect", "metaslider" ),
1208
+ 'class' => 'effect coin flex responsive nivo',
1209
+ 'helptext' => __( "Slide transition effect", "metaslider" ),
1210
+ 'options' => array(
1211
+ 'random' => array( 'class' => 'option coin nivo' , 'label' => __( "Random", "metaslider" ) ),
1212
+ 'swirl' => array( 'class' => 'option coin', 'label' => __( "Swirl", "metaslider" ) ),
1213
+ 'rain' => array( 'class' => 'option coin', 'label' => __( "Rain", "metaslider" ) ),
1214
+ 'straight' => array( 'class' => 'option coin', 'label' => __( "Straight", "metaslider" ) ),
1215
+ 'sliceDown' => array( 'class' => 'option nivo', 'label' => __( "Slide Down", "metaslider" ) ),
1216
+ 'sliceUp' => array( 'class' => 'option nivo', 'label' => __( "Slice Up", "metaslider" ) ),
1217
+ 'sliceUpLeft' => array( 'class' => 'option nivo', 'label' => __( "Slide Up Left", "metaslider" ) ),
1218
+ 'sliceUpDown' => array( 'class' => 'option nivo', 'label' => __( "Slice Up Down", "metaslider" ) ),
1219
+ 'slideUpDownLeft' => array( 'class' => 'option nivo', 'label' => __( "Slide Up Down Left", "metaslider" ) ),
1220
+ 'fold' => array( 'class' => 'option nivo', 'label' => __( "Fold", "metaslider" ) ),
1221
+ 'fade' => array( 'class' => 'option nivo flex responsive', 'label' => __( "Fade", "metaslider" ) ),
1222
+ 'slideInRight' => array( 'class' => 'option nivo', 'label' => __( "Slide In Right", "metaslider" ) ),
1223
+ 'slideInLeft' => array( 'class' => 'option nivo', 'label' => __( "Slide In Left", "metaslider" ) ),
1224
+ 'boxRandom' => array( 'class' => 'option nivo', 'label' => __( "Box Random", "metaslider" ) ),
1225
+ 'boxRain' => array( 'class' => 'option nivo', 'label' => __( "Box Rain", "metaslider" ) ),
1226
+ 'boxRainReverse' => array( 'class' => 'option nivo', 'label' => __( "Box Rain Reverse", "metaslider" ) ),
1227
+ 'boxRainGrowReverse' => array( 'class' => 'option nivo', 'label' => __( "Box Rain Grow Reverse", "metaslider" ) ),
1228
+ 'slide' => array( 'class' => 'option flex', 'label' => __( "Slide", "metaslider" ) )
1229
  ),
1230
+ ),
1231
+ 'theme' => array(
1232
+ 'priority' => 40,
1233
+ 'type' => 'theme',
1234
+ 'value' => $this->slider->get_setting( 'theme' ),
1235
+ 'label' => __( "Theme", "metaslider" ),
1236
+ 'class' => 'effect coin flex responsive nivo',
1237
+ 'helptext' => __( "Slideshow theme", "metaslider" ),
1238
+ 'options' => array(
1239
+ 'default' => array( 'class' => 'option nivo flex coin responsive' , 'label' => __( "Default", "metaslider" ) ),
1240
+ 'dark' => array( 'class' => 'option nivo', 'label' => __( "Dark (Nivo)", "metaslider" ) ),
1241
+ 'light' => array( 'class' => 'option nivo', 'label' => __( "Light (Nivo)", "metaslider" ) ),
1242
+ 'bar' => array( 'class' => 'option nivo', 'label' => __( "Bar (Nivo)", "metaslider" ) ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1243
  ),
1244
+ ),
1245
+ 'links' => array(
1246
+ 'priority' => 50,
1247
+ 'type' => 'checkbox',
1248
+ 'label' => __( "Arrows", "metaslider" ),
1249
+ 'class' => 'option coin flex nivo responsive',
1250
+ 'checked' => $this->slider->get_setting( 'links' ) == 'true' ? 'checked' : '',
1251
+ 'helptext' => __( "Show the previous/next arrows", "metaslider" )
1252
+ ),
1253
+ 'navigation' => array(
1254
+ 'priority' => 60,
1255
+ 'type' => 'navigation',
1256
+ 'label' => __( "Navigation", "metaslider" ),
1257
+ 'class' => 'option coin flex nivo responsive',
1258
+ 'value' => $this->slider->get_setting( 'navigation' ),
1259
+ 'helptext' => __( "Show the slide navigation bullets", "metaslider" ),
1260
+ 'options' => array(
1261
+ 'false' => array( 'label' => __( "Hidden", "metaslider" ) ),
1262
+ 'true' => array( 'label' => __( "Dots", "metaslider" ) ),
1263
+ )
1264
+ ),
1265
+ );
1266
+
1267
+ if ( $this->get_view() == 'dropdown' ) {
1268
+ $aFields['title'] = array(
1269
+ 'type' => 'title',
1270
+ 'priority' => 5,
1271
+ 'class' => 'option flex nivo responsive coin',
1272
+ 'value' => get_the_title($this->slider->id),
1273
+ 'label' => __( "Title", "metaslider" ),
1274
+ 'helptext' => __( "Slideshow title", "metaslider" )
1275
  );
1276
+ }
1277
 
1278
+ $aFields = apply_filters( 'metaslider_basic_settings', $aFields, $this->slider );
1279
+
1280
+ echo $this->build_settings_rows( $aFields );
1281
+ ?>
1282
+ </tbody>
1283
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
1284
  </div>
1285
+ </div>
1286
 
1287
+ <div class="ms-postbox ms-toggle closed" id="metaslider_advanced_settings">
1288
+ <div class="handlediv" title="Click to toggle"><br></div><h3 class="hndle"><span><?php _e( "Advanced Settings", "metaslider" ) ?></span></h3>
1289
+ <div class="inside">
1290
+ <table>
1291
+ <tbody>
1292
+ <?php
1293
+ $aFields = array(
1294
+ 'fullWidth' => array(
1295
+ 'priority' => 5,
1296
+ 'type' => 'checkbox',
1297
+ 'label' => __( "Stretch", "metaslider" ),
1298
+ 'class' => 'option flex nivo responsive',
1299
+ 'after' => __( "100% wide output", "metaslider" ),
1300
+ 'checked' => $this->slider->get_setting( 'fullWidth' ) == 'true' ? 'checked' : '',
1301
+ 'helptext' => __( "Stretch the slideshow output to fill it's parent container", "metaslider" )
1302
+ ),
1303
+ 'center' => array(
1304
+ 'priority' => 10,
1305
+ 'type' => 'checkbox',
1306
+ 'label' => __( "Center align", "metaslider" ),
1307
+ 'class' => 'option coin flex nivo responsive',
1308
+ 'checked' => $this->slider->get_setting( 'center' ) == 'true' ? 'checked' : '',
1309
+ 'helptext' => __( "Center align the slideshow", "metaslider" )
1310
+ ),
1311
+ 'autoPlay' => array(
1312
+ 'priority' => 20,
1313
+ 'type' => 'checkbox',
1314
+ 'label' => __( "Auto play", "metaslider" ),
1315
+ 'class' => 'option flex nivo responsive',
1316
+ 'checked' => $this->slider->get_setting( 'autoPlay' ) == 'true' ? 'checked' : '',
1317
+ 'helptext' => __( "Transition between slides automatically", "metaslider" )
1318
+ ),
1319
+ 'smartCrop' => array(
1320
+ 'priority' => 30,
1321
+ 'type' => 'select',
1322
+ 'label' => __( "Image Crop", "metaslider" ),
1323
+ 'class' => 'option coin flex nivo responsive',
1324
+ 'value' => $this->slider->get_setting( 'smartCrop' ),
1325
+ 'options' => array(
1326
+ 'true' => array( 'label' => __( "Smart", "metaslider" ), 'class' => '' ),
1327
+ 'false' => array( 'label' => __( "Standard", "metaslider" ), 'class' => '' ),
1328
+ 'disabled' => array( 'label' => __( "Disabled", "metaslider" ), 'class' => '' ),
1329
  ),
1330
+ 'helptext' => __( "Smart Crop ensures your responsive slides are cropped to a ratio that results in a consistent slideshow size", "metaslider" )
1331
+ ),
1332
+ 'carouselMode' => array(
1333
+ 'priority' => 40,
1334
+ 'type' => 'checkbox',
1335
+ 'label' => __( "Carousel mode", "metaslider" ),
1336
+ 'class' => 'option flex showNextWhenChecked',
1337
+ 'checked' => $this->slider->get_setting( 'carouselMode' ) == 'true' ? 'checked' : '',
1338
+ 'helptext' => __( "Display multiple slides at once. Slideshow output will be 100% wide.", "metaslider" )
1339
+ ),
1340
+ 'carouselMargin' => array(
1341
+ 'priority' => 45,
1342
+ 'min' => 0,
1343
+ 'max' => 9999,
1344
+ 'step' => 1,
1345
+ 'type' => 'number',
1346
+ 'label' => __( "Carousel margin", "metaslider" ),
1347
+ 'class' => 'option flex',
1348
+ 'value' => $this->slider->get_setting( 'carouselMargin' ),
1349
+ 'helptext' => __( "Pixel margin between slides in carousel.", "metaslider" ),
1350
+ 'after' => __( "px", "metaslider" )
1351
+ ),
1352
+ 'random' => array(
1353
+ 'priority' => 50,
1354
+ 'type' => 'checkbox',
1355
+ 'label' => __( "Random", "metaslider" ),
1356
+ 'class' => 'option coin flex nivo responsive',
1357
+ 'checked' => $this->slider->get_setting( 'random' ) == 'true' ? 'checked' : '',
1358
+ 'helptext' => __( "Randomise the order of the slides", "metaslider" )
1359
+ ),
1360
+ 'hoverPause' => array(
1361
+ 'priority' => 60,
1362
+ 'type' => 'checkbox',
1363
+ 'label' => __( "Hover pause", "metaslider" ),
1364
+ 'class' => 'option coin flex nivo responsive',
1365
+ 'checked' => $this->slider->get_setting( 'hoverPause' ) == 'true' ? 'checked' : '',
1366
+ 'helptext' => __( "Pause the slideshow when hovering over slider, then resume when no longer hovering.", "metaslider" )
1367
+ ),
1368
+ 'reverse' => array(
1369
+ 'priority' => 70,
1370
+ 'type' => 'checkbox',
1371
+ 'label' => __( "Reverse", "metaslider" ),
1372
+ 'class' => 'option flex',
1373
+ 'checked' => $this->slider->get_setting( 'reverse' ) == 'true' ? 'checked' : '',
1374
+ 'helptext' => __( "Reverse the animation direction", "metaslider" )
1375
+ ),
1376
+ 'delay' => array(
1377
+ 'priority' => 80,
1378
+ 'type' => 'number',
1379
+ 'size' => 3,
1380
+ 'min' => 500,
1381
+ 'max' => 10000,
1382
+ 'step' => 100,
1383
+ 'value' => $this->slider->get_setting( 'delay' ),
1384
+ 'label' => __( "Slide delay", "metaslider" ),
1385
+ 'class' => 'option coin flex responsive nivo',
1386
+ 'helptext' => __( "How long to display each slide, in milliseconds", "metaslider" ),
1387
+ 'after' => __( "ms", "metaslider" )
1388
+ ),
1389
+ 'animationSpeed' => array(
1390
+ 'priority' => 90,
1391
+ 'type' => 'number',
1392
+ 'size' => 3,
1393
+ 'min' => 0,
1394
+ 'max' => 2000,
1395
+ 'step' => 100,
1396
+ 'value' => $this->slider->get_setting( 'animationSpeed' ),
1397
+ 'label' => __( "Animation speed", "metaslider" ),
1398
+ 'class' => 'option flex responsive nivo',
1399
+ 'helptext' => __( "Set the speed of animations, in milliseconds", "metaslider" ),
1400
+ 'after' => __( "ms", "metaslider" )
1401
+ ),
1402
+ 'slices' => array(
1403
+ 'priority' => 100,
1404
+ 'type' => 'number',
1405
+ 'size' => 3,
1406
+ 'min' => 0,
1407
+ 'max' => 20,
1408
+ 'step' => 1,
1409
+ 'value' => $this->slider->get_setting( 'slices' ),
1410
+ 'label' => __( "Number of slices", "metaslider" ),
1411
+ 'class' => 'option nivo',
1412
+ 'helptext' => __( "Number of slices", "metaslider" ),
1413
+ 'after' => __( "ms", "metaslider" )
1414
+ ),
1415
+ 'spw' => array(
1416
+ 'priority' => 110,
1417
+ 'type' => 'number',
1418
+ 'size' => 3,
1419
+ 'min' => 0,
1420
+ 'max' => 20,
1421
+ 'step' => 1,
1422
+ 'value' => $this->slider->get_setting( 'spw' ),
1423
+ 'label' => __( "Number of squares", "metaslider" ) . " (" . __( "Width", "metaslider" ) . ")",
1424
+ 'class' => 'option nivo',
1425
+ 'helptext' => __( "Number of squares", "metaslider" ),
1426
+ 'after' => ''
1427
+ ),
1428
+ 'sph' => array(
1429
+ 'priority' => 120,
1430
+ 'type' => 'number',
1431
+ 'size' => 3,
1432
+ 'min' => 0,
1433
+ 'max' => 20,
1434
+ 'step' => 1,
1435
+ 'value' => $this->slider->get_setting( 'sph' ),
1436
+ 'label' => __( "Number of squares", "metaslider" ) . " (" . __( "Height", "metaslider" ) . ")",
1437
+ 'class' => 'option nivo',
1438
+ 'helptext' => __( "Number of squares", "metaslider" ),
1439
+ 'after' => ''
1440
+ ),
1441
+ 'direction' => array(
1442
+ 'priority' => 130,
1443
+ 'type' => 'select',
1444
+ 'label' => __( "Slide direction", "metaslider" ),
1445
+ 'class' => 'option flex',
1446
+ 'helptext' => __( "Select the sliding direction", "metaslider" ),
1447
+ 'value' => $this->slider->get_setting( 'direction' ),
1448
+ 'options' => array(
1449
+ 'horizontal' => array( 'label' => __( "Horizontal", "metaslider" ), 'class' => '' ),
1450
+ 'vertical' => array( 'label' => __( "Vertical", "metaslider" ), 'class' => '' ),
1451
+ )
1452
+ ),
1453
+ 'easing' => array(
1454
+ 'priority' => 140,
1455
+ 'type' => 'select',
1456
+ 'label' => __( "Easing", "metaslider" ),
1457
+ 'class' => 'option flex',
1458
+ 'helptext' => __( "Animation easing effect", "metaslider" ),
1459
+ 'value' => $this->slider->get_setting( 'easing' ),
1460
+ 'options' => $this->get_easing_options()
1461
+ ),
1462
+ 'prevText' => array(
1463
+ 'priority' => 150,
1464
+ 'type' => 'text',
1465
+ 'label' => __( "Previous text", "metaslider" ),
1466
+ 'class' => 'option coin flex responsive nivo',
1467
+ 'helptext' => __( "Set the text for the 'previous' direction item", "metaslider" ),
1468
+ 'value' => $this->slider->get_setting( 'prevText' ) == 'false' ? '' : $this->slider->get_setting( 'prevText' )
1469
+ ),
1470
+ 'nextText' => array(
1471
+ 'priority' => 160,
1472
+ 'type' => 'text',
1473
+ 'label' => __( "Next text", "metaslider" ),
1474
+ 'class' => 'option coin flex responsive nivo',
1475
+ 'helptext' => __( "Set the text for the 'next' direction item", "metaslider" ),
1476
+ 'value' => $this->slider->get_setting( 'nextText' ) == 'false' ? '' : $this->slider->get_setting( 'nextText' )
1477
+ ),
1478
+ 'sDelay' => array(
1479
+ 'priority' => 170,
1480
+ 'type' => 'number',
1481
+ 'size' => 3,
1482
+ 'min' => 0,
1483
+ 'max' => 500,
1484
+ 'step' => 10,
1485
+ 'value' => $this->slider->get_setting( 'sDelay' ),
1486
+ 'label' => __( "Square delay", "metaslider" ),
1487
+ 'class' => 'option coin',
1488
+ 'helptext' => __( "Delay between squares in ms", "metaslider" ),
1489
+ 'after' => __( "ms", "metaslider" )
1490
+ ),
1491
+ 'opacity' => array(
1492
+ 'priority' => 180,
1493
+ 'type' => 'number',
1494
+ 'size' => 3,
1495
+ 'min' => 0,
1496
+ 'max' => 1,
1497
+ 'step' => 0.1,
1498
+ 'value' => $this->slider->get_setting( 'opacity' ),
1499
+ 'label' => __( "Opacity", "metaslider" ),
1500
+ 'class' => 'option coin',
1501
+ 'helptext' => __( "Opacity of title and navigation", "metaslider" ),
1502
+ 'after' => ''
1503
+ ),
1504
+ 'titleSpeed' => array(
1505
+ 'priority' => 190,
1506
+ 'type' => 'number',
1507
+ 'size' => 3,
1508
+ 'min' => 0,
1509
+ 'max' => 10000,
1510
+ 'step' => 100,
1511
+ 'value' => $this->slider->get_setting( 'titleSpeed' ),
1512
+ 'label' => __( "Caption speed", "metaslider" ),
1513
+ 'class' => 'option coin',
1514
+ 'helptext' => __( "Set the fade in speed of the caption", "metaslider" ),
1515
+ 'after' => __( "ms", "metaslider" )
1516
+ ),
1517
+ 'developerOptions' => array(
1518
+ 'priority' => 195,
1519
+ 'type' => 'divider',
1520
+ 'class' => 'option coin flex responsive nivo',
1521
+ 'value' => __( "Developer options", "metaslider" )
1522
+ ),
1523
+ 'cssClass' => array(
1524
+ 'priority' => 200,
1525
+ 'type' => 'text',
1526
+ 'label' => __( "CSS classes", "metaslider" ),
1527
+ 'class' => 'option coin flex responsive nivo',
1528
+ 'helptext' => __( "Specify any custom CSS Classes you would like to be added to the slider wrapper", "metaslider" ),
1529
+ 'value' => $this->slider->get_setting( 'cssClass' ) == 'false' ? '' : $this->slider->get_setting( 'cssClass' )
1530
+ ),
1531
+ 'printCss' => array(
1532
+ 'priority' => 210,
1533
+ 'type' => 'checkbox',
1534
+ 'label' => __( "Print CSS", "metaslider" ),
1535
+ 'class' => 'option coin flex responsive nivo useWithCaution',
1536
+ 'checked' => $this->slider->get_setting( 'printCss' ) == 'true' ? 'checked' : '',
1537
+ 'helptext' => __( "Uncheck this is you would like to include your own CSS", "metaslider" )
1538
+ ),
1539
+ 'printJs' => array(
1540
+ 'priority' => 220,
1541
+ 'type' => 'checkbox',
1542
+ 'label' => __( "Print JS", "metaslider" ),
1543
+ 'class' => 'option coin flex responsive nivo useWithCaution',
1544
+ 'checked' => $this->slider->get_setting( 'printJs' ) == 'true' ? 'checked' : '',
1545
+ 'helptext' => __( "Uncheck this is you would like to include your own Javascript", "metaslider" )
1546
+ ),
1547
+ 'noConflict' => array(
1548
+ 'priority' => 230,
1549
+ 'type' => 'checkbox',
1550
+ 'label' => __( "No conflict mode", "metaslider" ),
1551
+ 'class' => 'option flex',
1552
+ 'checked' => $this->slider->get_setting( 'noConflict' ) == 'true' ? 'checked' : '',
1553
+ 'helptext' => __( "Delay adding the flexslider class to the slideshow", "metaslider" )
1554
+ ),
1555
+ );
1556
+
1557
+ $aFields = apply_filters( 'metaslider_advanced_settings', $aFields, $this->slider );
1558
+
1559
+ echo $this->build_settings_rows( $aFields );
1560
+ ?>
1561
+ </tbody>
1562
+ </table>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1563
  </div>
1564
+ </div>
1565
 
1566
+ <div class="ms-postbox shortcode ms-toggle" id="metaslider_usage">
1567
+ <div class="handlediv" title="Click to toggle"><br></div><h3 class="hndle"><span><?php _e( "Usage", "metaslider" ) ?></span></h3>
1568
+ <div class="inside">
1569
+ <ul class='tabs'>
1570
+ <li rel='tab-1' class='selected'><?php _e( "Shortcode", "metaslider" ) ?></li>
1571
+ <li rel='tab-2'><?php _e( "Template Include", "metaslider" ) ?></li>
1572
+ </ul>
1573
+ <div class='tabs-content'>
1574
+ <div class='tab tab-1'>
1575
+ <p><?php _e( "Copy & paste the shortcode directly into any WordPress post or page.", "metaslider" ); ?></p>
1576
+ <input readonly='readonly' type='text' value='[metaslider id=<?php echo $this->slider->id ?>]' /></div>
1577
+ <div class='tab tab-2' style='display: none'>
1578
+ <p><?php _e( "Copy & paste this code into a template file to include the slideshow within your theme.", "metaslider" ); ?></p>
1579
+ <textarea readonly='readonly'>&lt;?php &#13;&#10; echo do_shortcode("[metaslider id=<?php echo $this->slider->id ?>]"); &#13;&#10;?></textarea></div>
 
1580
  </div>
1581
  </div>
1582
+ </div>
1583
 
1584
+ <?php if ( ! is_plugin_active('ml-slider-pro/ml-slider-pro.php') ) : ?>
1585
+
1586
+ <div class="ms-postbox social" id="metaslider_social">
1587
+ <div class="inside">
1588
+ <ul class='info'>
1589
+ <li style='width: 33%;'>
1590
+ <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.metaslider.com" data-text="Check out Meta Slider, an easy to use slideshow plugin for WordPress" data-hashtags="metaslider, wordpress, slideshow">Tweet</a>
1591
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
1592
+ </li>
1593
+ <li style='width: 34%;'>
1594
+ <div class="g-plusone" data-size="medium" data-href="http://www.metaslider.com"></div>
1595
+ <script type="text/javascript">
1596
+ (function() {
1597
+ var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
1598
+ po.src = 'https://apis.google.com/js/plusone.js';
1599
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
1600
+ })();
1601
+ </script>
1602
+ </li>
1603
+ <li style='width: 33%;'>
1604
+ <iframe style='border:none; overflow:hidden; width:80px; height:21px;' src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.metaslider.com&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;font&amp;colorscheme=light&amp;action=like&amp;height=21&amp;appId=156668027835524" scrolling="no" frameborder="0" allowTransparency="true"></iframe>
1605
+ </li>
1606
+ </ul>
1607
  </div>
 
1608
  </div>
1609
+
1610
+ <?php endif; ?>
1611
+
1612
+ <a class='delete-slider alignright button-secondary' href='<?php echo wp_nonce_url( "?page=metaslider&amp;delete={$this->slider->id}", "metaslider_delete_slider" ); ?>'><?php _e( "Delete Slider", "metaslider" ) ?></a>
1613
  </div>
1614
  </div>
1615
  </div>
1700
  }
1701
 
1702
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1703
  /**
1704
  * Upgrade CTA.
1705
  */
1706
  public function upgrade_to_pro_cta() {
1707
+ global $user_ID;
1708
 
1709
  if ( function_exists( 'is_plugin_active' ) && ! is_plugin_active( 'ml-slider-pro/ml-slider-pro.php' ) ) {
1710
  $link = apply_filters( 'metaslider_hoplink', 'http://www.metaslider.com/upgrade/' );
1711
 
1712
  $link .= '?utm_source=lite&amp;utm_medium=nag&amp;utm_campaign=pro';
1713
 
1714
+ $text = "Meta Slider v" . METASLIDER_VERSION;
1715
+
1716
+ if ( get_user_meta( $user_ID, "metaslider_hide_go_pro", true ) === "true" ) {
1717
+ $text .= " - " . __( 'Upgrade to Pro $19', "metaslider" );
1718
+ }
1719
+
1720
+ echo "<div style='display: none;' id='screen-options-link-wrap'><a target='_blank' class='show-settings dashicons-before dashicons-performance' href='{$link}'>{$text}</a></div>";
1721
 
 
1722
  }
1723
 
1724
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: wordpress slideshow,seo,slideshow,slider,widget,wordpress slider,image sli
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CQ84KC4X8YKW8
5
  Requires at least: 3.5
6
  Tested up to: 4.0
7
- Stable tag: 3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -144,6 +144,20 @@ See www.metaslider.com/documentation/image-cropping/
144
 
145
  == Changelog ==
146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  = 3.0.1 [19/08/14] =
148
 
149
  * Fix: Escape admin setting text fields
4
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CQ84KC4X8YKW8
5
  Requires at least: 3.5
6
  Tested up to: 4.0
7
+ Stable tag: 3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
144
 
145
  == Changelog ==
146
 
147
+ = 3.1.1 [21/10/14] =
148
+
149
+ * Fix: restrict_to shortcode parameter
150
+ * Change: Add metaslider_flex_slider_list_item_attributes filter
151
+
152
+ = 3.1 [14/10/14] =
153
+
154
+ * New feature: Ajax delete slide (to stop users from losing changes when deleting a slide)
155
+ * New feature: restrict_to shortcode parameter now accepts page IDs
156
+ * Update: Change icon
157
+ * Fix: Minor admin styling fix
158
+ * Fix: Hide share buttons for pro users
159
+ * Change: Remove upgrade nags from media library, add Go Pro page (with an option to hide the page)
160
+
161
  = 3.0.1 [19/08/14] =
162
 
163
  * Fix: Escape admin setting text fields