Version Description
- Processes shortcodes.
- Nofollow link option.
Download this release
Release Info
Developer | syammohanm |
Plugin | WPFront Notification Bar |
Version | 1.6 |
Comparing to | |
See all releases |
Code changes from version 1.5.2 to 1.6
classes/class-wpfront-notification-bar-options.php
CHANGED
@@ -42,6 +42,7 @@ if (!class_exists('WPFront_Notification_Bar_Options')) {
|
|
42 |
$this->addOption('position', 'int', 1, array($this, 'validate_1or2'))->__('Position');
|
43 |
$this->addOption('height', 'int', 0, array($this, 'validate_zero_positive'))->__('Bar Height');
|
44 |
$this->addOption('message', 'string', '')->__('Message Text');
|
|
|
45 |
$this->addOption('display_after', 'int', 1, array($this, 'validate_zero_positive'))->__('Display After');
|
46 |
$this->addOption('animate_delay', 'float', 0.5, array($this, 'validate_zero_positive'))->__('Animation Duration');
|
47 |
$this->addOption('close_button', 'bool', FALSE)->__('Display Close Button');
|
@@ -51,6 +52,7 @@ if (!class_exists('WPFront_Notification_Bar_Options')) {
|
|
51 |
$this->addOption('button_action', 'int', 1, array($this, 'validate_1or2'))->__('Button Action');
|
52 |
$this->addOption('button_action_url', 'string', '')->__('Open URL:');
|
53 |
$this->addOption('button_action_new_tab', 'bool', FALSE)->__('Open URL in new tab/window');
|
|
|
54 |
$this->addOption('button_action_javascript', 'string', '')->__('Execute JavaScript');
|
55 |
$this->addOption('button_action_close_bar', 'bit', FALSE)->__('Close Bar on Button Click');
|
56 |
$this->addOption('display_shadow', 'bit', FALSE)->__('Display Shadow');
|
42 |
$this->addOption('position', 'int', 1, array($this, 'validate_1or2'))->__('Position');
|
43 |
$this->addOption('height', 'int', 0, array($this, 'validate_zero_positive'))->__('Bar Height');
|
44 |
$this->addOption('message', 'string', '')->__('Message Text');
|
45 |
+
$this->addOption('message_process_shortcode', 'bit', FALSE)->__('Process Shortcode');
|
46 |
$this->addOption('display_after', 'int', 1, array($this, 'validate_zero_positive'))->__('Display After');
|
47 |
$this->addOption('animate_delay', 'float', 0.5, array($this, 'validate_zero_positive'))->__('Animation Duration');
|
48 |
$this->addOption('close_button', 'bool', FALSE)->__('Display Close Button');
|
52 |
$this->addOption('button_action', 'int', 1, array($this, 'validate_1or2'))->__('Button Action');
|
53 |
$this->addOption('button_action_url', 'string', '')->__('Open URL:');
|
54 |
$this->addOption('button_action_new_tab', 'bool', FALSE)->__('Open URL in new tab/window');
|
55 |
+
$this->addOption('button_action_url_nofollow', 'bool', FALSE)->__('No follow link');
|
56 |
$this->addOption('button_action_javascript', 'string', '')->__('Execute JavaScript');
|
57 |
$this->addOption('button_action_close_bar', 'bit', FALSE)->__('Close Bar on Button Click');
|
58 |
$this->addOption('display_shadow', 'bit', FALSE)->__('Display Shadow');
|
classes/class-wpfront-notification-bar.php
CHANGED
@@ -36,7 +36,7 @@ if (!class_exists('WPFront_Notification_Bar')) {
|
|
36 |
class WPFront_Notification_Bar extends WPFront_Base {
|
37 |
|
38 |
//Constants
|
39 |
-
const VERSION = '1.
|
40 |
const OPTIONS_GROUP_NAME = 'wpfront-notification-bar-options-group';
|
41 |
const OPTION_NAME = 'wpfront-notification-bar-options';
|
42 |
const PLUGIN_SLUG = 'wpfront-notification-bar';
|
@@ -169,6 +169,16 @@ if (!class_exists('WPFront_Notification_Bar')) {
|
|
169 |
|
170 |
$this->markupLoaded = TRUE;
|
171 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
172 |
|
173 |
protected function get_filter_objects() {
|
174 |
$objects = array();
|
36 |
class WPFront_Notification_Bar extends WPFront_Base {
|
37 |
|
38 |
//Constants
|
39 |
+
const VERSION = '1.6';
|
40 |
const OPTIONS_GROUP_NAME = 'wpfront-notification-bar-options-group';
|
41 |
const OPTION_NAME = 'wpfront-notification-bar-options';
|
42 |
const PLUGIN_SLUG = 'wpfront-notification-bar';
|
169 |
|
170 |
$this->markupLoaded = TRUE;
|
171 |
}
|
172 |
+
|
173 |
+
protected function get_message_text() {
|
174 |
+
$message = $this->options->message();
|
175 |
+
|
176 |
+
if($this->options->message_process_shortcode()) {
|
177 |
+
$message = do_shortcode($message);
|
178 |
+
}
|
179 |
+
|
180 |
+
return $message;
|
181 |
+
}
|
182 |
|
183 |
protected function get_filter_objects() {
|
184 |
$objects = array();
|
readme.txt
CHANGED
@@ -3,8 +3,8 @@ Contributors: syammohanm
|
|
3 |
Donate link: http://wpfront.com/donate/
|
4 |
Tags: notification bar, wordpress notification bar, top bar, bottom bar, notification, bar, quick bar, fixed bar, sticky bar, message bar, message, floating bar, notice, sticky header, special offer, discount offer, offer, important, attention bar, highlight bar, popup bar, hellobar, heads up, heads up bar, headsup, headsupbar, popup, Toolbar
|
5 |
Requires at least: 3.0
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -15,6 +15,7 @@ Want to display a notification about a promotion or a news? WPFront Notification
|
|
15 |
|
16 |
### Features
|
17 |
* Display a **message** with a **button** (optional).
|
|
|
18 |
* Button will **open a URL** or **execute JavaScript**.
|
19 |
* **Position** the bar on **top** or **bottom**.
|
20 |
* Can be **fixed at position** (Sticky Bar).
|
@@ -68,6 +69,10 @@ The new version(1.3) allows you to filter the bar based on user roles. In this c
|
|
68 |
|
69 |
== Changelog ==
|
70 |
|
|
|
|
|
|
|
|
|
71 |
= 1.5.2 =
|
72 |
* WP eMember integration.
|
73 |
|
@@ -111,6 +116,9 @@ The new version(1.3) allows you to filter the bar based on user roles. In this c
|
|
111 |
|
112 |
== Upgrade Notice ==
|
113 |
|
|
|
|
|
|
|
114 |
= 1.5.2 =
|
115 |
* WP eMember integration.
|
116 |
|
3 |
Donate link: http://wpfront.com/donate/
|
4 |
Tags: notification bar, wordpress notification bar, top bar, bottom bar, notification, bar, quick bar, fixed bar, sticky bar, message bar, message, floating bar, notice, sticky header, special offer, discount offer, offer, important, attention bar, highlight bar, popup bar, hellobar, heads up, heads up bar, headsup, headsupbar, popup, Toolbar
|
5 |
Requires at least: 3.0
|
6 |
+
Tested up to: 4.4
|
7 |
+
Stable tag: 1.6
|
8 |
License: GPLv3
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
15 |
|
16 |
### Features
|
17 |
* Display a **message** with a **button** (optional).
|
18 |
+
* Processes **shortcodes**.
|
19 |
* Button will **open a URL** or **execute JavaScript**.
|
20 |
* **Position** the bar on **top** or **bottom**.
|
21 |
* Can be **fixed at position** (Sticky Bar).
|
69 |
|
70 |
== Changelog ==
|
71 |
|
72 |
+
= 1.6 =
|
73 |
+
* Processes shortcodes.
|
74 |
+
* Nofollow link option.
|
75 |
+
|
76 |
= 1.5.2 =
|
77 |
* WP eMember integration.
|
78 |
|
116 |
|
117 |
== Upgrade Notice ==
|
118 |
|
119 |
+
= 1.6 =
|
120 |
+
* Processes shortcodes.
|
121 |
+
|
122 |
= 1.5.2 =
|
123 |
* WP eMember integration.
|
124 |
|
templates/notification-bar-template.php
CHANGED
@@ -102,12 +102,12 @@
|
|
102 |
<tr>
|
103 |
<td>
|
104 |
<div class="wpfront-message">
|
105 |
-
<?php echo $this->
|
106 |
</div>
|
107 |
<div>
|
108 |
<?php if ($this->options->display_button()) { ?>
|
109 |
<?php if ($this->options->button_action() == 1) { ?>
|
110 |
-
<a class="wpfront-button" href="<?php echo $this->options->button_action_url(); ?>" target="<?php echo $this->options->button_action_new_tab() ? '_blank' : '_self'; ?>"
|
111 |
<?php } ?>
|
112 |
<?php if ($this->options->button_action() == 2) { ?>
|
113 |
<a class="wpfront-button" onclick="javascript:wpfront_notification_bar_button_action_script();"><?php echo $this->options->button_text(); ?></a>
|
102 |
<tr>
|
103 |
<td>
|
104 |
<div class="wpfront-message">
|
105 |
+
<?php echo $this->get_message_text(); ?>
|
106 |
</div>
|
107 |
<div>
|
108 |
<?php if ($this->options->display_button()) { ?>
|
109 |
<?php if ($this->options->button_action() == 1) { ?>
|
110 |
+
<a class="wpfront-button" href="<?php echo $this->options->button_action_url(); ?>" target="<?php echo $this->options->button_action_new_tab() ? '_blank' : '_self'; ?>" <?php echo $this->options->button_action_url_nofollow() ? 'rel="nofollow"' : ''; ?>><?php echo $this->options->button_text(); ?></a>
|
111 |
<?php } ?>
|
112 |
<?php if ($this->options->button_action() == 2) { ?>
|
113 |
<a class="wpfront-button" onclick="javascript:wpfront_notification_bar_button_action_script();"><?php echo $this->options->button_text(); ?></a>
|
templates/options-template.php
CHANGED
@@ -170,6 +170,14 @@
|
|
170 |
<span class="description"><?php echo esc_html($this->__('[HTML tags are allowed. e.g. Add <br /> for break.]')); ?></span>
|
171 |
</td>
|
172 |
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
<tr>
|
174 |
<th scope="row">
|
175 |
<?php echo $this->options->display_button_label(); ?>
|
@@ -202,6 +210,11 @@
|
|
202 |
<span><?php echo $this->options->button_action_new_tab_label(); ?></span>
|
203 |
</label>
|
204 |
<br />
|
|
|
|
|
|
|
|
|
|
|
205 |
<label>
|
206 |
<input type="radio" name="<?php echo $this->options->button_action_name(); ?>" value="2" <?php echo $this->options->button_action() == 2 ? 'checked' : ''; ?> />
|
207 |
<span><?php echo $this->options->button_action_javascript_label(); ?></span>
|
@@ -317,7 +330,7 @@
|
|
317 |
<br />
|
318 |
<label>
|
319 |
<input type="radio" name="<?php echo $this->options->display_roles_name(); ?>" value="4" <?php echo $this->options->display_roles() == 4 ? 'checked' : ''; ?> />
|
320 |
-
<span><?php echo $this->__('For following user roles'); ?></span>
|
321 |
</label>
|
322 |
<br />
|
323 |
<div class="roles-selection">
|
170 |
<span class="description"><?php echo esc_html($this->__('[HTML tags are allowed. e.g. Add <br /> for break.]')); ?></span>
|
171 |
</td>
|
172 |
</tr>
|
173 |
+
<tr>
|
174 |
+
<th scope="row">
|
175 |
+
<?php echo $this->options->message_process_shortcode_label(); ?>
|
176 |
+
</th>
|
177 |
+
<td>
|
178 |
+
<input type="checkbox" name="<?php echo $this->options->message_process_shortcode_name(); ?>" <?php echo $this->options->message_process_shortcode() ? 'checked' : ''; ?> /> <span class="description"><?php echo $this->__('[Processes shortcodes in message text.]'); ?></span>
|
179 |
+
</td>
|
180 |
+
</tr>
|
181 |
<tr>
|
182 |
<th scope="row">
|
183 |
<?php echo $this->options->display_button_label(); ?>
|
210 |
<span><?php echo $this->options->button_action_new_tab_label(); ?></span>
|
211 |
</label>
|
212 |
<br />
|
213 |
+
<label>
|
214 |
+
<input type="checkbox" name="<?php echo $this->options->button_action_url_nofollow_name(); ?>" <?php echo $this->options->button_action_url_nofollow() ? 'checked' : ''; ?> />
|
215 |
+
<span><?php echo $this->options->button_action_url_nofollow_label(); ?></span>
|
216 |
+
</label>
|
217 |
+
<br />
|
218 |
<label>
|
219 |
<input type="radio" name="<?php echo $this->options->button_action_name(); ?>" value="2" <?php echo $this->options->button_action() == 2 ? 'checked' : ''; ?> />
|
220 |
<span><?php echo $this->options->button_action_javascript_label(); ?></span>
|
330 |
<br />
|
331 |
<label>
|
332 |
<input type="radio" name="<?php echo $this->options->display_roles_name(); ?>" value="4" <?php echo $this->options->display_roles() == 4 ? 'checked' : ''; ?> />
|
333 |
+
<span><?php echo $this->__('For following user roles'); ?></span> <span>[<a target="_blank" href="https://wpfront.com/nbtoure"><?php echo $this->__('Manage Roles'); ?>]</a></span>
|
334 |
</label>
|
335 |
<br />
|
336 |
<div class="roles-selection">
|
wpfront-notification-bar.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: WPFront Notification Bar
|
4 |
* Plugin URI: http://wpfront.com/notification-bar-plugin/
|
5 |
* Description: Easily lets you create a bar on top or bottom to display a notification.
|
6 |
-
* Version: 1.
|
7 |
* Author: Syam Mohan
|
8 |
* Author URI: http://wpfront.com
|
9 |
* License: GPL v3
|
3 |
* Plugin Name: WPFront Notification Bar
|
4 |
* Plugin URI: http://wpfront.com/notification-bar-plugin/
|
5 |
* Description: Easily lets you create a bar on top or bottom to display a notification.
|
6 |
+
* Version: 1.6
|
7 |
* Author: Syam Mohan
|
8 |
* Author URI: http://wpfront.com
|
9 |
* License: GPL v3
|