Better Notifications for WordPress - Version 1.0.2

Version Description

  • Bug fix for [ID] shortcode not outputting anything.
  • Bug fix for [post_category] showing as empty.
  • Added tags shortcode for use in certain notifications using [post_tag].
Download this release

Release Info

Developer voltronik
Plugin Icon 128x128 Better Notifications for WordPress
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 +6 -1
  2. bnfw.php +1 -1
  3. includes/engine/class-bnfw-engine.php +5 -1
README.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: voltronik
3
  Tags: notifications, email, alerts, roles, users, HTML
4
  Requires at least: 3.5
5
  Tested up to: 4.1
6
- Stable tag: 1.0.1
7
  License: GPLv3
8
 
9
  Send customisable HTML emails to your users for different WordPress notifications.
@@ -119,6 +119,11 @@ It might do but this is untested.
119
 
120
  == Changelog ==
121
 
 
 
 
 
 
122
  = 1.0.1 =
123
  * Bug fix for notifications not being sent to custom user roles or individual users of custom roles.
124
  * Added a 'Notification Type' column to the notifications screen.
3
  Tags: notifications, email, alerts, roles, users, HTML
4
  Requires at least: 3.5
5
  Tested up to: 4.1
6
+ Stable tag: 1.0.2
7
  License: GPLv3
8
 
9
  Send customisable HTML emails to your users for different WordPress notifications.
119
 
120
  == Changelog ==
121
 
122
+ = 1.0.2 =
123
+ * Bug fix for [ID] shortcode not outputting anything.
124
+ * Bug fix for `[post_category]` showing as empty.
125
+ * Added tags shortcode for use in certain notifications using `[post_tag]`.
126
+
127
  = 1.0.1 =
128
  * Bug fix for notifications not being sent to custom user roles or individual users of custom roles.
129
  * Added a 'Notification Type' column to the notifications screen.
bnfw.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Better Notifications for WordPress
4
  Plugin URI: http://wordpress.org/plugins/bnfw/
5
  Description: Send customisable HTML emails to your users for different WordPress notifications.
6
- Version: 1.0.1
7
  Author: Voltronik
8
  Author URI: http://www.voltronik.co.uk/
9
  Author Email: plugins@voltronik.co.uk
3
  Plugin Name: Better Notifications for WordPress
4
  Plugin URI: http://wordpress.org/plugins/bnfw/
5
  Description: Send customisable HTML emails to your users for different WordPress notifications.
6
+ Version: 1.0.2
7
  Author: Voltronik
8
  Author URI: http://www.voltronik.co.uk/
9
  Author Email: plugins@voltronik.co.uk
includes/engine/class-bnfw-engine.php CHANGED
@@ -94,9 +94,12 @@ class BNFW_Engine {
94
  $message = str_replace( '[post_mime_type]', $post->post_mime_type, $message );
95
  $message = str_replace( '[comment_count]', $post->comment_count, $message );
96
 
97
- $category_list = implode( ',', wp_get_post_categories( $post_id, array( 'fields' => 'name') ) );
98
  $message = str_replace( '[post_category]', $category_list, $message );
99
 
 
 
 
100
  return $message;
101
  }
102
 
@@ -136,6 +139,7 @@ class BNFW_Engine {
136
  private function user_shortcodes( $message, $user_id ) {
137
  $user_info = get_userdata( $user_id );
138
 
 
139
  $message = str_replace( '[user_login]', $user_info->user_login, $message );
140
  $message = str_replace( '[user_nicename]', $user_info->user_nicename, $message );
141
  $message = str_replace( '[user_email]', $user_info->user_email, $message );
94
  $message = str_replace( '[post_mime_type]', $post->post_mime_type, $message );
95
  $message = str_replace( '[comment_count]', $post->comment_count, $message );
96
 
97
+ $category_list = implode( ',', wp_get_post_categories( $post_id, array( 'fields' => 'names') ) );
98
  $message = str_replace( '[post_category]', $category_list, $message );
99
 
100
+ $tag_list = implode( ',', wp_get_post_tags( $post_id, array( 'fields' => 'names') ) );
101
+ $message = str_replace( '[post_tag]', $tag_list, $message );
102
+
103
  return $message;
104
  }
105
 
139
  private function user_shortcodes( $message, $user_id ) {
140
  $user_info = get_userdata( $user_id );
141
 
142
+ $message = str_replace( '[ID]', $user_info->ID, $message );
143
  $message = str_replace( '[user_login]', $user_info->user_login, $message );
144
  $message = str_replace( '[user_nicename]', $user_info->user_nicename, $message );
145
  $message = str_replace( '[user_email]', $user_info->user_email, $message );