Simple Banner - Version 1.0.2

Version Description

  • Fixed banner for themes that don't already have jquery added.
Download this release

Release Info

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

Code changes from version 1.0.1 to 1.0.2

Files changed (3) hide show
  1. readme.txt +8 -2
  2. simple-banner.js +1 -1
  3. simple-banner.php +5 -4
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Simple Banner ===
2
  Contributors: rpetersen29
3
  Donate link:
4
- Tags: cta, banner, announcement, notification, bar, free, hello bar, hellobar
5
  Requires at least: 3.0.1
6
  Tested up to: 4.2.2
7
- Stable tag: 1.0.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -44,6 +44,9 @@ Yes.
44
 
45
  == Changelog ==
46
 
 
 
 
47
  = 1.0.1 =
48
  * Fixed readme and added logo.
49
 
@@ -52,6 +55,9 @@ Yes.
52
 
53
  == Upgrade Notice ==
54
 
 
 
 
55
  = 1.0.1 =
56
  Just updated some stuff for the readme. No functionality change.
57
 
1
  === Simple Banner ===
2
  Contributors: rpetersen29
3
  Donate link:
4
+ Tags: cta, banner, banners, announcement, announcements, notification, bar, bars, free, hello bar, hellobar
5
  Requires at least: 3.0.1
6
  Tested up to: 4.2.2
7
+ Stable tag: 1.0.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
44
 
45
  == Changelog ==
46
 
47
+ = 1.0.2 =
48
+ * Fixed banner for themes that don't already have jquery added.
49
+
50
  = 1.0.1 =
51
  * Fixed readme and added logo.
52
 
55
 
56
  == Upgrade Notice ==
57
 
58
+ = 1.0.2 =
59
+ If your banner didn't work before, it probably does now.
60
+
61
  = 1.0.1 =
62
  Just updated some stuff for the readme. No functionality change.
63
 
simple-banner.js CHANGED
@@ -1,4 +1,4 @@
1
- $(document).ready(function() {
2
  $('<div id="simple-banner" class="simple-banner"></div>')
3
  .prependTo('body');
4
  });
1
+ jQuery(document).ready(function($){
2
  $('<div id="simple-banner" class="simple-banner"></div>')
3
  .prependTo('body');
4
  });
simple-banner.php CHANGED
@@ -3,13 +3,13 @@
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: 1.0.1
7
  * Author: Ryan Petersen
8
  * Author URI: http://rpetersen29.github.io/
9
  * License: GPL2
10
  *
11
  * @package Simple Banner
12
- * @version 1.0.1
13
  * @author Ryan Petersen <rpetersen@arcwebtech.com>
14
  */
15
 
@@ -19,7 +19,8 @@ function simple_banner() {
19
  wp_register_style('simple-banner-style', plugin_dir_url( __FILE__ ) .'simple-banner.css');
20
  wp_enqueue_style('simple-banner-style');
21
  // Enqueue the script
22
- wp_register_script('simple-banner-script', plugin_dir_url( __FILE__ ) . 'simple-banner.js');
 
23
  wp_enqueue_script('simple-banner-script');
24
  }
25
 
@@ -49,7 +50,7 @@ add_action( 'wp_head', 'simple_banner_custom_text');
49
  function simple_banner_custom_text()
50
  {
51
  if (get_option('simple_banner_text') != ""){
52
- echo '<script type="text/javascript">$(document).ready(function() {
53
  var bannerSpan = document.getElementById("simple-banner");
54
  bannerSpan.innerHTML = "<div class=' . "simple-banner-text" . '><span>' . get_option('simple_banner_text') . '</span></div>"
55
  });
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: 1.0.2
7
  * Author: Ryan Petersen
8
  * Author URI: http://rpetersen29.github.io/
9
  * License: GPL2
10
  *
11
  * @package Simple Banner
12
+ * @version 1.0.2
13
  * @author Ryan Petersen <rpetersen@arcwebtech.com>
14
  */
15
 
19
  wp_register_style('simple-banner-style', plugin_dir_url( __FILE__ ) .'simple-banner.css');
20
  wp_enqueue_style('simple-banner-style');
21
  // Enqueue the script
22
+ wp_register_script('simple-banner-script', plugin_dir_url( __FILE__ ) . 'simple-banner.js',
23
+ array( 'jquery' ));
24
  wp_enqueue_script('simple-banner-script');
25
  }
26
 
50
  function simple_banner_custom_text()
51
  {
52
  if (get_option('simple_banner_text') != ""){
53
+ echo '<script type="text/javascript">jQuery(document).ready(function() {
54
  var bannerSpan = document.getElementById("simple-banner");
55
  bannerSpan.innerHTML = "<div class=' . "simple-banner-text" . '><span>' . get_option('simple_banner_text') . '</span></div>"
56
  });