Simple Banner - Version 2.9.4

Version Description

  • Bug fixes for disabled pages array.
Download this release

Release Info

Developer rpetersen29
Plugin Icon 128x128 Simple Banner
Version 2.9.4
Comparing to
See all releases

Code changes from version 2.9.3 to 2.9.4

Files changed (2) hide show
  1. readme.txt +7 -1
  2. simple-banner.php +11 -11
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.me/rpetersenDev
4
  Tags: banner, banners, simple, announcement, announcements, bulletin, bulletins, notification, notifications, notification bar, notice, notices, notice bar, top bar, cta, ctas, bar, bars, free, hello bar, hellobar, pro
5
  Requires at least: 3.0.1
6
  Tested up to: 5.6.0
7
- Stable tag: 2.9.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -118,6 +118,9 @@ Set your banner position to <code>relative</code> and try this in 'Website Custo
118
 
119
  == Changelog ==
120
 
 
 
 
121
  = 2.9.3 =
122
  * Bug fixes for disabled pages.
123
 
@@ -259,6 +262,9 @@ Set your banner position to <code>relative</code> and try this in 'Website Custo
259
 
260
  == Upgrade Notice ==
261
 
 
 
 
262
  = 2.9.3 =
263
  * Bug fixes for disabled pages.
264
 
4
  Tags: banner, banners, simple, announcement, announcements, bulletin, bulletins, notification, notifications, notification bar, notice, notices, notice bar, top bar, cta, ctas, bar, bars, free, hello bar, hellobar, pro
5
  Requires at least: 3.0.1
6
  Tested up to: 5.6.0
7
+ Stable tag: 2.9.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
118
 
119
  == Changelog ==
120
 
121
+ = 2.9.4 =
122
+ * Bug fixes for disabled pages array.
123
+
124
  = 2.9.3 =
125
  * Bug fixes for disabled pages.
126
 
262
 
263
  == Upgrade Notice ==
264
 
265
+ = 2.9.4 =
266
+ * Bug fixes for disabled pages array.
267
+
268
  = 2.9.3 =
269
  * Bug fixes for disabled pages.
270
 
simple-banner.php CHANGED
@@ -3,16 +3,16 @@
3
  * Plugin Name: Simple Banner
4
  * Plugin URI: https://github.com/rpetersen29/simple-banner
5
  * Description: Display a simple banner at the top of your website.
6
- * Version: 2.9.3
7
  * Author: Ryan Petersen
8
  * Author URI: http://rpetersen29.github.io/
9
  * License: GPL2
10
  *
11
  * @package Simple Banner
12
- * @version 2.9.3
13
  * @author Ryan Petersen <rpetersen.dev@gmail.com>
14
  */
15
- define ('VERSION', '2.9.3');
16
 
17
  register_activation_hook( __FILE__, 'simple_banner_activate' );
18
  function simple_banner_activate() {
@@ -25,7 +25,7 @@ function simple_banner() {
25
  wp_register_style('simple-banner-style', plugin_dir_url( __FILE__ ) .'simple-banner.css', '', VERSION);
26
  wp_enqueue_style('simple-banner-style');
27
  // Set Script parameters
28
- $disabled_pages_array = explode(',', get_option('disabled_pages_array'));
29
  $disabled_on_current_page = !empty($disabled_pages_array) && in_array(get_the_ID(), $disabled_pages_array);
30
  $script_params = array(
31
  // script specific parameters
@@ -73,9 +73,9 @@ if ( function_exists( 'wp_body_open' ) && get_option('wp_body_open_enabled') ) {
73
  }
74
  function simple_banner_body_open() {
75
  // if not disabled use wp_body_open
76
- $disabled_pages_array = get_option('disabled_pages_array');
77
  $close_button_enabled = get_option('close_button_enabled');
78
- $disabled_on_current_page = !empty($disabled_pages_array) && in_array(get_the_ID(), explode(',', $disabled_pages_array));
79
  $closed_cookie = $close_button_enabled && isset($_COOKIE['simplebannerclosed']);
80
  $closed_button = get_option('close_button_enabled') ? '<button id="simple-banner-close-button" class="simple-banner-button">&#x2715;</button>' : '';
81
 
@@ -94,8 +94,8 @@ function simple_banner_custom_color()
94
  {
95
  $closed_cookie = get_option('close_button_enabled') && isset($_COOKIE["simplebannerclosed"]);
96
 
97
- $disabled_pages_array = get_option('disabled_pages_array');
98
- $disabled_on_current_page = !empty($disabled_pages_array) && in_array(get_the_ID(), explode(',', $disabled_pages_array));
99
  $banner_is_disabled = $disabled_on_current_page || get_option('hide_simple_banner') == "yes";
100
 
101
  if ($banner_is_disabled || $closed_cookie){
@@ -606,14 +606,14 @@ function simple_banner_settings_page() {
606
  <?php
607
  $pages = get_pages();
608
  $disabled = !get_option('pro_version_enabled');
609
- $disabled_pages_array = get_option('disabled_pages_array');
610
  $frontpage_id = get_option( 'page_on_front' ); // page_on_front returns 0 if value hasn't been set
611
  if ($frontpage_id == 0) {
612
  $frontpage_id = 1;
613
  }
614
  $parent_checkbox = '<input type="checkbox" ';
615
  $parent_checkbox .= $disabled ? 'disabled ' : '';
616
- $parent_checkbox .= (!$disabled && in_array($frontpage_id, explode(",", $disabled_pages_array))) ? 'checked ' : '';
617
  $parent_checkbox .= 'value="' . $frontpage_id . '">';
618
  $parent_checkbox .= get_option( 'blogname' ) . ' | ' . get_site_url() . ' ';
619
  $parent_checkbox .= '</input><br>';
@@ -621,7 +621,7 @@ function simple_banner_settings_page() {
621
  foreach ( $pages as $page ) {
622
  $checkbox = '<input type="checkbox"';
623
  $checkbox .= $disabled ? 'disabled ' : '';
624
- $checkbox .= (!$disabled && in_array($page->ID, explode(",", $disabled_pages_array))) ? 'checked ' : '';
625
  $checkbox .= 'value="' . $page->ID . '">';
626
  $checkbox .= $page->post_title . ' | ' . get_page_link( $page->ID ) . ' ';
627
  $checkbox .= '</input><br>';
3
  * Plugin Name: Simple Banner
4
  * Plugin URI: https://github.com/rpetersen29/simple-banner
5
  * Description: Display a simple banner at the top of your website.
6
+ * Version: 2.9.4
7
  * Author: Ryan Petersen
8
  * Author URI: http://rpetersen29.github.io/
9
  * License: GPL2
10
  *
11
  * @package Simple Banner
12
+ * @version 2.9.4
13
  * @author Ryan Petersen <rpetersen.dev@gmail.com>
14
  */
15
+ define ('VERSION', '2.9.4');
16
 
17
  register_activation_hook( __FILE__, 'simple_banner_activate' );
18
  function simple_banner_activate() {
25
  wp_register_style('simple-banner-style', plugin_dir_url( __FILE__ ) .'simple-banner.css', '', VERSION);
26
  wp_enqueue_style('simple-banner-style');
27
  // Set Script parameters
28
+ $disabled_pages_array = array_filter(explode(',', get_option('disabled_pages_array')));
29
  $disabled_on_current_page = !empty($disabled_pages_array) && in_array(get_the_ID(), $disabled_pages_array);
30
  $script_params = array(
31
  // script specific parameters
73
  }
74
  function simple_banner_body_open() {
75
  // if not disabled use wp_body_open
76
+ $disabled_pages_array = array_filter(explode(',', get_option('disabled_pages_array')));
77
  $close_button_enabled = get_option('close_button_enabled');
78
+ $disabled_on_current_page = !empty($disabled_pages_array) && in_array(get_the_ID(), $disabled_pages_array);
79
  $closed_cookie = $close_button_enabled && isset($_COOKIE['simplebannerclosed']);
80
  $closed_button = get_option('close_button_enabled') ? '<button id="simple-banner-close-button" class="simple-banner-button">&#x2715;</button>' : '';
81
 
94
  {
95
  $closed_cookie = get_option('close_button_enabled') && isset($_COOKIE["simplebannerclosed"]);
96
 
97
+ $disabled_pages_array = array_filter(explode(',', get_option('disabled_pages_array')));
98
+ $disabled_on_current_page = !empty($disabled_pages_array) && in_array(get_the_ID(), $disabled_pages_array);
99
  $banner_is_disabled = $disabled_on_current_page || get_option('hide_simple_banner') == "yes";
100
 
101
  if ($banner_is_disabled || $closed_cookie){
606
  <?php
607
  $pages = get_pages();
608
  $disabled = !get_option('pro_version_enabled');
609
+ $disabled_pages_array = array_filter(explode(',', get_option('disabled_pages_array')));
610
  $frontpage_id = get_option( 'page_on_front' ); // page_on_front returns 0 if value hasn't been set
611
  if ($frontpage_id == 0) {
612
  $frontpage_id = 1;
613
  }
614
  $parent_checkbox = '<input type="checkbox" ';
615
  $parent_checkbox .= $disabled ? 'disabled ' : '';
616
+ $parent_checkbox .= (!$disabled && in_array($frontpage_id, $disabled_pages_array)) ? 'checked ' : '';
617
  $parent_checkbox .= 'value="' . $frontpage_id . '">';
618
  $parent_checkbox .= get_option( 'blogname' ) . ' | ' . get_site_url() . ' ';
619
  $parent_checkbox .= '</input><br>';
621
  foreach ( $pages as $page ) {
622
  $checkbox = '<input type="checkbox"';
623
  $checkbox .= $disabled ? 'disabled ' : '';
624
+ $checkbox .= (!$disabled && in_array($page->ID, $disabled_pages_array)) ? 'checked ' : '';
625
  $checkbox .= 'value="' . $page->ID . '">';
626
  $checkbox .= $page->post_title . ' | ' . get_page_link( $page->ID ) . ' ';
627
  $checkbox .= '</input><br>';