Version Description
N/A
Download this release
Release Info
Developer | yoffegil |
Plugin | Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page |
Version | 7.5.0 |
Comparing to | |
See all releases |
Code changes from version 7.4.0 to 7.5.0
- opinionstage-polls.php +3 -2
- opinionstage-widget.php +50 -0
- readme.txt +2 -0
opinionstage-polls.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Social Polls by OpinionStage
|
4 |
Plugin URI: http://www.opinionstage.com
|
5 |
Description: Adds a highly engaging social polling system to your blog. You can easily add a social poll to your blog post/page by clicking the social poll icon in the WordPress post/page text editor.
|
6 |
-
Version: 7.
|
7 |
Author: OpinionStage.com
|
8 |
Author URI: http://www.opinionstage.com
|
9 |
*/
|
@@ -11,7 +11,7 @@ Author URI: http://www.opinionstage.com
|
|
11 |
/* --- Static initializer for Wordpress hooks --- */
|
12 |
|
13 |
define('OPINIONSTAGE_SERVER_BASE', "www.opinionstage.com"); /* Don't include the protocol, added dynamically */
|
14 |
-
define('OPINIONSTAGE_WIDGET_VERSION', '7.
|
15 |
define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Social Polls by OpinionStage');
|
16 |
define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
|
17 |
define('OPINIONSTAGE_WIDGET_SHORTCODE', 'socialpoll');
|
@@ -19,6 +19,7 @@ define('OPINIONSTAGE_WIDGET_UNIQUE_ID', 'social-polls-by-opinionstage');
|
|
19 |
define('OPINIONSTAGE_WIDGET_UNIQUE_LOCATION', __FILE__);
|
20 |
|
21 |
require_once(WP_PLUGIN_DIR."/".OPINIONSTAGE_WIDGET_UNIQUE_ID."/opinionstage-functions.php");
|
|
|
22 |
|
23 |
|
24 |
/* --- Static initializer for Wordpress hooks --- */
|
3 |
Plugin Name: Social Polls by OpinionStage
|
4 |
Plugin URI: http://www.opinionstage.com
|
5 |
Description: Adds a highly engaging social polling system to your blog. You can easily add a social poll to your blog post/page by clicking the social poll icon in the WordPress post/page text editor.
|
6 |
+
Version: 7.5.0
|
7 |
Author: OpinionStage.com
|
8 |
Author URI: http://www.opinionstage.com
|
9 |
*/
|
11 |
/* --- Static initializer for Wordpress hooks --- */
|
12 |
|
13 |
define('OPINIONSTAGE_SERVER_BASE', "www.opinionstage.com"); /* Don't include the protocol, added dynamically */
|
14 |
+
define('OPINIONSTAGE_WIDGET_VERSION', '7.5.0');
|
15 |
define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Social Polls by OpinionStage');
|
16 |
define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
|
17 |
define('OPINIONSTAGE_WIDGET_SHORTCODE', 'socialpoll');
|
19 |
define('OPINIONSTAGE_WIDGET_UNIQUE_LOCATION', __FILE__);
|
20 |
|
21 |
require_once(WP_PLUGIN_DIR."/".OPINIONSTAGE_WIDGET_UNIQUE_ID."/opinionstage-functions.php");
|
22 |
+
require_once(WP_PLUGIN_DIR."/".OPINIONSTAGE_WIDGET_UNIQUE_ID."/opinionstage-widget.php");
|
23 |
|
24 |
|
25 |
/* --- Static initializer for Wordpress hooks --- */
|
opinionstage-widget.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class OpinionStageWidget extends WP_Widget {
|
3 |
+
function OpinionStageWidget() {
|
4 |
+
$widget_ops = array('classname' => 'opinionstage_widget', 'description' => __('Adds a highly engaging social polling system to your widget section.', OPINIONSTAGE_WIDGET_UNIQUE_ID));
|
5 |
+
$this->WP_Widget('opinionstage_widget', __('Opinion Stage Poll', OPINIONSTAGE_WIDGET_UNIQUE_ID), $widget_ops);
|
6 |
+
}
|
7 |
+
|
8 |
+
function widget($args, $instance) {
|
9 |
+
extract($args);
|
10 |
+
echo $before_widget;
|
11 |
+
$title = @$instance['title'];
|
12 |
+
$poll_id = @$instance['poll_id'];
|
13 |
+
$display = @$instance['display'];
|
14 |
+
if (!empty($title)) echo $before_title . apply_filters('widget_title', $title) . $after_title;
|
15 |
+
if (!empty($poll_id) && $display == 1) echo do_shortcode('[' . OPINIONSTAGE_WIDGET_SHORTCODE . ' id="' . $poll_id . '"]');
|
16 |
+
echo $after_widget;
|
17 |
+
}
|
18 |
+
|
19 |
+
function update($new_instance, $old_instance) {
|
20 |
+
$instance = $old_instance;
|
21 |
+
$instance['title'] = strip_tags($new_instance['title']);
|
22 |
+
$instance['poll_id'] = strip_tags($new_instance['poll_id']);
|
23 |
+
$instance['display'] = strip_tags($new_instance['display']);
|
24 |
+
return $instance;
|
25 |
+
}
|
26 |
+
|
27 |
+
function form($instance) {
|
28 |
+
$title = isset($instance['title']) ? esc_attr($instance['title']) : '';
|
29 |
+
$poll_id = isset($instance['poll_id']) ? esc_attr($instance['poll_id']) : '';
|
30 |
+
$display = isset($instance['display']) ? esc_attr($instance['display']) : 1;
|
31 |
+
?>
|
32 |
+
<p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', OPINIONSTAGE_WIDGET_UNIQUE_ID); ?></label>
|
33 |
+
<input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /></p>
|
34 |
+
|
35 |
+
<p><label for="<?php echo $this->get_field_id('display'); ?>"><?php _e('Display:', OPINIONSTAGE_WIDGET_UNIQUE_ID); ?></label>
|
36 |
+
<select class="widefat" name="<?php echo $this->get_field_name('display'); ?>" id="<?php echo $this->get_field_id('display'); ?>"><option value="1" <?php selected($display, 1) ?>>Display Poll</option><option value="0" <?php selected($display, 0) ?>>Do not display anything (Disable)</option></select></p>
|
37 |
+
|
38 |
+
<p><label for="<?php echo $this->get_field_id('poll_id'); ?>"><?php _e('Poll ID:', OPINIONSTAGE_WIDGET_UNIQUE_ID); ?></label>
|
39 |
+
<input class="widefat" id="<?php echo $this->get_field_id('poll_id'); ?>" name="<?php echo $this->get_field_name('poll_id'); ?>" type="text" value="<?php echo $poll_id; ?>" /></p>
|
40 |
+
<p><?php echo opinionstage_create_link('Manage my polls', 'dashboard', ''); ?></p>
|
41 |
+
<?php
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
function opinionstage_init_widget() {
|
46 |
+
register_widget('OpinionStageWidget');
|
47 |
+
}
|
48 |
+
|
49 |
+
add_action('widgets_init', 'opinionstage_init_widget');
|
50 |
+
?>
|
readme.txt
CHANGED
@@ -116,6 +116,8 @@ Yes, just post the following syntax into any post/page: [socialpoll ID="xyz"], w
|
|
116 |
N/A
|
117 |
|
118 |
== Changelog ==
|
|
|
|
|
119 |
= Version 7.4.0 =
|
120 |
* Poll performance optimizations
|
121 |
= Version 7.3.0 =
|
116 |
N/A
|
117 |
|
118 |
== Changelog ==
|
119 |
+
= Version 7.5.0 =
|
120 |
+
* Created a widget for easily adding polls to site
|
121 |
= Version 7.4.0 =
|
122 |
* Poll performance optimizations
|
123 |
= Version 7.3.0 =
|