Cyclone Slider - Version 2.9.1

Version Description

  • 2014-12-10 =
  • Fix. Restored missing widget code.
Download this release

Release Info

Developer kosinix
Plugin Icon 128x128 Cyclone Slider
Version 2.9.1
Comparing to
See all releases

Code changes from version 2.9.0 to 2.9.1

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://www.codefleet.net/donate/
4
  Tags: slider, slideshow, drag-and-drop, wordpress-slider, wordpress-slideshow, cycle 2, jquery, responsive, translation-ready, custom-post, cyclone-slider
5
  Requires at least: 3.5
6
  Tested up to: 4.0.1
7
- Stable tag: 2.9.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -103,6 +103,9 @@ Inside `wp-content` create a folder named "cycloneslider". Add your templates in
103
 
104
  == Changelog ==
105
 
 
 
 
106
  = 2.9.0 - 2014-12-09 =
107
  * Change. Major code refactoring for future features to be easily added
108
 
@@ -324,6 +327,9 @@ Inside `wp-content` create a folder named "cycloneslider". Add your templates in
324
 
325
  == Upgrade Notice ==
326
 
 
 
 
327
  = 2.9.0 - 2014-12-09 =
328
  * Change. Major code refactoring for future features to be easily added
329
 
4
  Tags: slider, slideshow, drag-and-drop, wordpress-slider, wordpress-slideshow, cycle 2, jquery, responsive, translation-ready, custom-post, cyclone-slider
5
  Requires at least: 3.5
6
  Tested up to: 4.0.1
7
+ Stable tag: 2.9.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
103
 
104
  == Changelog ==
105
 
106
+ = 2.9.1 - 2014-12-10 =
107
+ * Fix. Restored missing widget code.
108
+
109
  = 2.9.0 - 2014-12-09 =
110
  * Change. Major code refactoring for future features to be easily added
111
 
327
 
328
  == Upgrade Notice ==
329
 
330
+ = 2.9.1 - 2014-12-10 =
331
+ * Fix. Restored missing widget code.
332
+
333
  = 2.9.0 - 2014-12-09 =
334
  * Change. Major code refactoring for future features to be easily added
335
 
cyclone-slider.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Cyclone Slider 2
4
  Plugin URI: http://www.codefleet.net/cyclone-slider-2/
5
  Description: Create and manage sliders with ease. Built for both casual users and developers.
6
- Version: 2.9.0
7
  Author: Nico Amarilla
8
  Author URI: http://www.codefleet.net/
9
  License:
@@ -48,7 +48,7 @@ function cslider_init() {
48
  $plugin['url'] = plugin_dir_url(__FILE__);
49
 
50
  $plugin['debug'] = false;
51
- $plugin['version'] = '2.9.0';
52
  $plugin['textdomain'] = 'cycloneslider';
53
  $plugin['slug'] = 'cyclone-slider-2/cyclone-slider.php';
54
  $plugin['nonce_name'] = 'cyclone_slider_builder_nonce';
@@ -85,10 +85,9 @@ function cslider_init() {
85
 
86
  $plugin['frontend'] = new CycloneSlider_Frontend();
87
 
88
-
89
 
90
  $plugin->run();
91
 
92
  $cyclone_slider_plugin_instance = $plugin;
93
- }
94
-
3
  Plugin Name: Cyclone Slider 2
4
  Plugin URI: http://www.codefleet.net/cyclone-slider-2/
5
  Description: Create and manage sliders with ease. Built for both casual users and developers.
6
+ Version: 2.9.1
7
  Author: Nico Amarilla
8
  Author URI: http://www.codefleet.net/
9
  License:
48
  $plugin['url'] = plugin_dir_url(__FILE__);
49
 
50
  $plugin['debug'] = false;
51
+ $plugin['version'] = '2.9.1';
52
  $plugin['textdomain'] = 'cycloneslider';
53
  $plugin['slug'] = 'cyclone-slider-2/cyclone-slider.php';
54
  $plugin['nonce_name'] = 'cyclone_slider_builder_nonce';
85
 
86
  $plugin['frontend'] = new CycloneSlider_Frontend();
87
 
88
+ $plugin['widgets'] = new CycloneSlider_Widgets();
89
 
90
  $plugin->run();
91
 
92
  $cyclone_slider_plugin_instance = $plugin;
93
+ }
 
src/CycloneSlider/WidgetSlider.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class for Cyclone Slider widget
4
+ */
5
+ class CycloneSlider_WidgetSlider extends WP_Widget {
6
+
7
+ /**
8
+ * Constructor
9
+ */
10
+ public function __construct() {
11
+ parent::__construct(
12
+ 'cyclone-slider-widget', // Base ID
13
+ __( 'Cyclone Slider Widget', 'cycloneslider' ), // Name
14
+ array( 'description' => __( 'Widget for displaying sliders.', 'cycloneslider' ), ) // Args
15
+ );
16
+ }
17
+
18
+ /**
19
+ * Widget output
20
+ */
21
+ function widget( $args, $instance ) {
22
+ extract($args, EXTR_SKIP);
23
+
24
+ echo $before_widget;
25
+
26
+ if ( !empty($instance['title']) ) {
27
+ $title = apply_filters('widget_title', $instance['title']);
28
+ echo $before_title . $title . $after_title;
29
+ }
30
+ $slideshow = '';
31
+ if ( !empty($instance['slideshow']) ) {
32
+ $slideshow = $instance['slideshow'];
33
+ if( function_exists('cyclone_slider') ) cyclone_slider($slideshow);
34
+ }
35
+ echo $after_widget;
36
+ }
37
+
38
+ /**
39
+ * Widget on save
40
+ */
41
+ function update( $new_instance, $old_instance ) {
42
+ $instance = $old_instance;
43
+
44
+ $instance['title'] = strip_tags($new_instance['title']);
45
+ $instance['slideshow'] = strip_tags($new_instance['slideshow']);
46
+
47
+ return $instance;
48
+
49
+ }
50
+
51
+ /**
52
+ * Admin form
53
+ */
54
+ function form( $instance ) {
55
+ $defaults = array(
56
+ 'title' => '',
57
+ 'slideshow'=>''
58
+ );
59
+ $instance = wp_parse_args( (array) $instance, $defaults );
60
+
61
+ $slideshow = $instance['slideshow'];
62
+
63
+ ?>
64
+ <p>
65
+ <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'cycloneslider'); ?></label>
66
+ <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php esc_attr_e($instance['title']); ?>" />
67
+ </p>
68
+ <p>
69
+ <?php
70
+ $my_query = new WP_Query(
71
+ array(
72
+ 'post_type' => 'cycloneslider',
73
+ 'order'=>'ASC',
74
+ 'posts_per_page' => -1,
75
+ )
76
+ );
77
+ if($my_query->have_posts()):
78
+ ?>
79
+ <label for="<?php echo $this->get_field_id('slideshow'); ?>"><?php _e('Select a Slider:', 'cycloneslider'); ?></label>
80
+ <select class="widefat" id="<?php echo $this->get_field_id('slideshow'); ?>" name="<?php echo $this->get_field_name('slideshow'); ?>">
81
+ <option value=""></option>
82
+ <?php
83
+ global $post;
84
+ $old_post = $post;
85
+ while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
86
+ <option value="<?php echo $post->post_name; ?>" <?php echo $slideshow==$post->post_name ? 'selected="selected"': ''; ?>><?php the_title(); ?></option>
87
+ <?php
88
+ endwhile;
89
+ wp_reset_postdata();
90
+ $post = $old_post;
91
+ ?>
92
+ </select>
93
+ <?php else: ?>
94
+ <?php _e('No sliders found.', 'cycloneslider'); ?>
95
+ <?php endif; ?>
96
+ </p>
97
+ <?php
98
+
99
+ }
100
+
101
+ }
102
+
src/CycloneSlider/Widgets.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Class for initializing widgets
4
+ */
5
+ class CycloneSlider_Widgets extends CycloneSlider_Base {
6
+
7
+ /**
8
+ * Initialize
9
+ */
10
+ public function bootstrap() {
11
+ add_action('widgets_init', array( $this, 'register_widgets') );
12
+ }
13
+
14
+ /**
15
+ * Register to WP
16
+ */
17
+ public function register_widgets(){
18
+ register_widget('CycloneSlider_WidgetSlider');
19
+ }
20
+
21
+ } // end class