Version Description
N/A
Download this release
Release Info
Developer | yoffegil |
Plugin | Poll, Survey, Quiz, Slideshow, Form, Story & Landing Page |
Version | 10.9.0 |
Comparing to | |
See all releases |
Code changes from version 10.8.0 to 10.9.0
- opinionstage-functions.php +1 -1
- opinionstage-polls.php +2 -2
- opinionstage-widget.php +1 -1
- opinionstage_add_polls_to_all_posts.php +68 -18
- readme.txt +2 -0
opinionstage-functions.php
CHANGED
@@ -146,7 +146,7 @@ function opinionstage_add_poll_page() {
|
|
146 |
<li><?php echo opinionstage_create_link('Create a Set', 'sets/new', ''); ?></li>
|
147 |
<li><?php echo opinionstage_create_link('View Sets', 'dashboard', 'tab=sets'); ?></li>
|
148 |
<li><?php echo opinionstage_create_link('View Placements', 'dashboard', 'tab=containers'); ?></li>
|
149 |
-
<li><a href="<?php _e(admin_url('admin.php?page=addpollstoallposts')) ?>">Add
|
150 |
</ul>
|
151 |
<h2>Help</h2>
|
152 |
<ul class="os_links_list">
|
146 |
<li><?php echo opinionstage_create_link('Create a Set', 'sets/new', ''); ?></li>
|
147 |
<li><?php echo opinionstage_create_link('View Sets', 'dashboard', 'tab=sets'); ?></li>
|
148 |
<li><?php echo opinionstage_create_link('View Placements', 'dashboard', 'tab=containers'); ?></li>
|
149 |
+
<li><a href="<?php _e(admin_url('admin.php?page=addpollstoallposts')) ?>">Add Poll section to posts / pages</a></li>
|
150 |
</ul>
|
151 |
<h2>Help</h2>
|
152 |
<ul class="os_links_list">
|
opinionstage-polls.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Polls by OpinionStage
|
4 |
Plugin URI: http://www.opinionstage.com
|
5 |
Description: Adds a highly engaging social polling system to your site. Easily add polls to any post/page or to your sites sidebar.
|
6 |
-
Version: 10.
|
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', '10.
|
15 |
define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Polls by OpinionStage');
|
16 |
define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
|
17 |
define('OPINIONSTAGE_WIDGET_SHORTCODE', 'socialpoll');
|
3 |
Plugin Name: Polls by OpinionStage
|
4 |
Plugin URI: http://www.opinionstage.com
|
5 |
Description: Adds a highly engaging social polling system to your site. Easily add polls to any post/page or to your sites sidebar.
|
6 |
+
Version: 10.9.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', '10.9.0');
|
15 |
define('OPINIONSTAGE_WIDGET_PLUGIN_NAME', 'Polls by OpinionStage');
|
16 |
define('OPINIONSTAGE_WIDGET_API_KEY', 'wp35e8');
|
17 |
define('OPINIONSTAGE_WIDGET_SHORTCODE', 'socialpoll');
|
opinionstage-widget.php
CHANGED
@@ -34,7 +34,7 @@
|
|
34 |
<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>
|
35 |
|
36 |
<p>
|
37 |
-
<label for="<?php echo $this->get_field_id('type'); ?>"><?php _e('
|
38 |
<select class="widefat" name="<?php echo $this->get_field_name('type'); ?>" id="<?php echo $this->get_field_id('type'); ?>">
|
39 |
<option value="poll" <?php selected($type, 'poll') ?>>Poll</option>
|
40 |
<option value="set" <?php selected($type, 'set') ?>>Set</option>
|
34 |
<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>
|
35 |
|
36 |
<p>
|
37 |
+
<label for="<?php echo $this->get_field_id('type'); ?>"><?php _e('Content type:', OPINIONSTAGE_WIDGET_UNIQUE_ID); ?></label>
|
38 |
<select class="widefat" name="<?php echo $this->get_field_name('type'); ?>" id="<?php echo $this->get_field_id('type'); ?>">
|
39 |
<option value="poll" <?php selected($type, 'poll') ?>>Poll</option>
|
40 |
<option value="set" <?php selected($type, 'set') ?>>Set</option>
|
opinionstage_add_polls_to_all_posts.php
CHANGED
@@ -5,6 +5,8 @@
|
|
5 |
static function bootstrap() {
|
6 |
add_action($hook = 'admin_menu', array(__CLASS__, $hook));
|
7 |
add_filter($hook = 'the_content', array(__CLASS__, $hook));
|
|
|
|
|
8 |
}
|
9 |
|
10 |
static function admin_menu() {
|
@@ -12,20 +14,67 @@
|
|
12 |
$url = self::register_admin_page($page_callback);
|
13 |
}
|
14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
static function the_content($content) {
|
16 |
global $post;
|
17 |
-
$
|
18 |
-
if (
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
}
|
31 |
}
|
@@ -61,12 +110,13 @@
|
|
61 |
<div id="opinionstage-head"></div>
|
62 |
<div class="section">
|
63 |
<form action="" method="POST"
|
64 |
-
<h2>Add
|
65 |
<hr />
|
66 |
-
<h3>
|
67 |
<div class="chkboxs" style="background-color: #FFF; border: 1px solid #DDD; padding: 5px 20px 5px 10px; display: inline-block;">
|
68 |
<?php foreach ($post_types as $pt) { ?>
|
69 |
<?php
|
|
|
70 |
$is_checked = false;
|
71 |
if (is_array(os_get_option($opinionstage_aptap, 'post_types'))) {
|
72 |
$post_types = os_get_option($opinionstage_aptap, 'post_types');
|
@@ -77,22 +127,22 @@
|
|
77 |
<?php } ?>
|
78 |
</div>
|
79 |
<br />
|
80 |
-
<h3><label for="pt-ct">Select content
|
81 |
<select name="opinionstage_aptap[content_types]" id="pt-ct">
|
82 |
<option value="poll" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'poll' ? 'selected="selected"' : '') ?>>Poll</option>
|
83 |
-
<option value="container" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'container' ? 'selected="selected"' : '') ?>>Placement</option>
|
84 |
<option value="set" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'set' ? 'selected="selected"' : '') ?>>Set</option>
|
|
|
85 |
</select>
|
86 |
<br />
|
87 |
<h3><label for="pt-cnfid">Configure ID</label></h3>
|
88 |
<input type="text" value="<?php _e(os_get_option($opinionstage_aptap, 'configure_id')) ?>" name="opinionstage_aptap[configure_id]" id="pt-cnfid" />
|
89 |
-
<div><a href="#" id="pt-locid"
|
90 |
<br />
|
91 |
<p class="submit"><input type="submit" class="button button-primary" value="Save Changes"></p>
|
92 |
<br />
|
93 |
<div style="background-color: #FFF; border: 1px solid #DDD; padding: 5px 20px 5px 10px; display: inline-block; max-width: 300px;">Note: If you would like to add a poll to only one post/page, click on the Opinion Stage icon from the create post/page visual editor.</div>
|
94 |
<br />
|
95 |
-
<p>Need more help? <a href="http://blog.opinionstage.com/wordpress-poll-how-to-add-polls-to-wordpress-sites/"
|
96 |
</form>
|
97 |
</div>
|
98 |
</div>
|
5 |
static function bootstrap() {
|
6 |
add_action($hook = 'admin_menu', array(__CLASS__, $hook));
|
7 |
add_filter($hook = 'the_content', array(__CLASS__, $hook));
|
8 |
+
add_action($hook = 'add_meta_boxes', array(__CLASS__, $hook));
|
9 |
+
add_action($hook = 'save_post', array(__CLASS__, $hook));
|
10 |
}
|
11 |
|
12 |
static function admin_menu() {
|
14 |
$url = self::register_admin_page($page_callback);
|
15 |
}
|
16 |
|
17 |
+
static function add_meta_boxes() {
|
18 |
+
$post_types = get_post_types(array('public' => true));
|
19 |
+
foreach ($post_types as $pt) {
|
20 |
+
if ($pt == 'attachment') continue;
|
21 |
+
add_meta_box('aptap_meta', 'Poll Display', array(__CLASS__, 'render_meta_box'), $pt, 'normal', 'high');
|
22 |
+
}
|
23 |
+
}
|
24 |
+
|
25 |
+
static function get_aptap_post_setting($post_id) {
|
26 |
+
$aptap_post_setting = get_post_meta($post_id, 'aptap_post_setting', true);
|
27 |
+
if (empty($aptap_post_setting) || !is_numeric($aptap_post_setting) || ($aptap_post_setting <= 0 && $aptap_post_setting >= 4)) $aptap_post_setting = 1;
|
28 |
+
return $aptap_post_setting;
|
29 |
+
}
|
30 |
+
|
31 |
+
static function render_meta_box() {
|
32 |
+
global $post;
|
33 |
+
$aptap_post_setting = AddPollsToAllPosts::get_aptap_post_setting($post->ID);
|
34 |
+
?>
|
35 |
+
<label for="aptap_post_setting_1" class="selectit"><input name="aptap_post_setting" type="radio" id="aptap_post_setting_1" value="1" <?php checked($aptap_post_setting, 1) ?>>Use global setting for this post type.</label><br />
|
36 |
+
<!--<label for="aptap_post_setting_2" class="selectit"><input name="aptap_post_setting" type="radio" id="aptap_post_setting_2" value="2" <?php checked($aptap_post_setting, 2) ?>>Show selected poll at the end of this post.</label><br />-->
|
37 |
+
<label for="aptap_post_setting_3" class="selectit"><input name="aptap_post_setting" type="radio" id="aptap_post_setting_3" value="3" <?php checked($aptap_post_setting, 3) ?>>Don't show any polls at the end of this post.</label>
|
38 |
+
<?php
|
39 |
+
}
|
40 |
+
|
41 |
+
static function save_post($post_id) {
|
42 |
+
if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) return;
|
43 |
+
$aptap_post_setting = isset($_POST['aptap_post_setting']) && !empty($_POST['aptap_post_setting']) ? $_POST['aptap_post_setting'] : 1;
|
44 |
+
update_post_meta($post_id, 'aptap_post_setting', $aptap_post_setting);
|
45 |
+
}
|
46 |
+
|
47 |
static function the_content($content) {
|
48 |
global $post;
|
49 |
+
$aptap_post_setting = AddPollsToAllPosts::get_aptap_post_setting($post->ID);
|
50 |
+
if ($aptap_post_setting == 3) {
|
51 |
+
return $content;
|
52 |
+
/*
|
53 |
+
} else if ($aptap_post_setting == 2) {
|
54 |
+
$opinionstage_aptap = get_option('opinionstage_aptap');
|
55 |
+
$shortcode = do_shortcode(
|
56 |
+
sprintf(
|
57 |
+
'[socialpoll id="%s" type="%s"]',
|
58 |
+
$opinionstage_aptap['configure_id'],
|
59 |
+
$opinionstage_aptap['content_types']
|
60 |
+
)
|
61 |
+
);
|
62 |
+
return $content . $shortcode;
|
63 |
+
*/
|
64 |
+
} else {
|
65 |
+
$opinionstage_aptap = get_option('opinionstage_aptap');
|
66 |
+
if (is_array($opinionstage_aptap)) {
|
67 |
+
if (isset($opinionstage_aptap['post_types']) && !empty($opinionstage_aptap['post_types']) && is_array($opinionstage_aptap['post_types'])) {
|
68 |
+
if (in_array($post->post_type, $opinionstage_aptap['post_types'])) {
|
69 |
+
$shortcode = do_shortcode(
|
70 |
+
sprintf(
|
71 |
+
'[socialpoll id="%s" type="%s"]',
|
72 |
+
$opinionstage_aptap['configure_id'],
|
73 |
+
$opinionstage_aptap['content_types']
|
74 |
+
)
|
75 |
+
);
|
76 |
+
return $content . $shortcode;
|
77 |
+
}
|
78 |
}
|
79 |
}
|
80 |
}
|
110 |
<div id="opinionstage-head"></div>
|
111 |
<div class="section">
|
112 |
<form action="" method="POST"
|
113 |
+
<h2>Add Poll section to posts / pages</h2>
|
114 |
<hr />
|
115 |
+
<h3>Add to</h3>
|
116 |
<div class="chkboxs" style="background-color: #FFF; border: 1px solid #DDD; padding: 5px 20px 5px 10px; display: inline-block;">
|
117 |
<?php foreach ($post_types as $pt) { ?>
|
118 |
<?php
|
119 |
+
if ($pt == 'attachment') continue;
|
120 |
$is_checked = false;
|
121 |
if (is_array(os_get_option($opinionstage_aptap, 'post_types'))) {
|
122 |
$post_types = os_get_option($opinionstage_aptap, 'post_types');
|
127 |
<?php } ?>
|
128 |
</div>
|
129 |
<br />
|
130 |
+
<h3><label for="pt-ct">Select content types</label></h3>
|
131 |
<select name="opinionstage_aptap[content_types]" id="pt-ct">
|
132 |
<option value="poll" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'poll' ? 'selected="selected"' : '') ?>>Poll</option>
|
|
|
133 |
<option value="set" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'set' ? 'selected="selected"' : '') ?>>Set</option>
|
134 |
+
<option value="container" <?php _e(os_get_option($opinionstage_aptap, 'content_types') == 'container' ? 'selected="selected"' : '') ?>>Placement</option>
|
135 |
</select>
|
136 |
<br />
|
137 |
<h3><label for="pt-cnfid">Configure ID</label></h3>
|
138 |
<input type="text" value="<?php _e(os_get_option($opinionstage_aptap, 'configure_id')) ?>" name="opinionstage_aptap[configure_id]" id="pt-cnfid" />
|
139 |
+
<div><a href="#" id="pt-locid">Locate ID in Dashboard</a></div>
|
140 |
<br />
|
141 |
<p class="submit"><input type="submit" class="button button-primary" value="Save Changes"></p>
|
142 |
<br />
|
143 |
<div style="background-color: #FFF; border: 1px solid #DDD; padding: 5px 20px 5px 10px; display: inline-block; max-width: 300px;">Note: If you would like to add a poll to only one post/page, click on the Opinion Stage icon from the create post/page visual editor.</div>
|
144 |
<br />
|
145 |
+
<p>Need more help? <a href="http://blog.opinionstage.com/wordpress-poll-how-to-add-polls-to-wordpress-sites/">Click here!</a></p>
|
146 |
</form>
|
147 |
</div>
|
148 |
</div>
|
readme.txt
CHANGED
@@ -130,6 +130,8 @@ Yes, just post the following syntax into any post/page: [socialpoll ID="xyz"], w
|
|
130 |
N/A
|
131 |
|
132 |
== Changelog ==
|
|
|
|
|
133 |
= Version 10.8.0 =
|
134 |
* Texts changes
|
135 |
= Version 10.7.0 =
|
130 |
N/A
|
131 |
|
132 |
== Changelog ==
|
133 |
+
= Version 10.9.0 =
|
134 |
+
* Allow disabling global poll section for specific posts
|
135 |
= Version 10.8.0 =
|
136 |
* Texts changes
|
137 |
= Version 10.7.0 =
|