Changeset 3350070
- Timestamp:
- 08/26/2025 06:17:20 AM (7 months ago)
- Location:
- bnfw
- Files:
-
- 53 added
- 5 edited
-
tags/1.9.9 (added)
-
tags/1.9.9/README.txt (added)
-
tags/1.9.9/assets (added)
-
tags/1.9.9/assets/css (added)
-
tags/1.9.9/assets/css/bnfw.css (added)
-
tags/1.9.9/assets/css/select2.min.css (added)
-
tags/1.9.9/assets/img (added)
-
tags/1.9.9/assets/img/icon-256x256.png (added)
-
tags/1.9.9/assets/js (added)
-
tags/1.9.9/assets/js/bnfw.js (added)
-
tags/1.9.9/assets/js/select2.full.min.js (added)
-
tags/1.9.9/bnfw.php (added)
-
tags/1.9.9/includes (added)
-
tags/1.9.9/includes/admin (added)
-
tags/1.9.9/includes/admin/bnfw-settings.php (added)
-
tags/1.9.9/includes/admin/class-bnfw-notification.php (added)
-
tags/1.9.9/includes/admin/class-bnfw-settings.php (added)
-
tags/1.9.9/includes/class-bnfw-import.php (added)
-
tags/1.9.9/includes/engine (added)
-
tags/1.9.9/includes/engine/class-bnfw-engine.php (added)
-
tags/1.9.9/includes/helpers (added)
-
tags/1.9.9/includes/helpers/ajax-helpers.php (added)
-
tags/1.9.9/includes/helpers/class-bnfw-ajax.php (added)
-
tags/1.9.9/includes/helpers/helpers.php (added)
-
tags/1.9.9/includes/import.php (added)
-
tags/1.9.9/includes/libraries (added)
-
tags/1.9.9/includes/libraries/EDD_SL_Plugin_Updater.php (added)
-
tags/1.9.9/includes/libraries/class-edd-sl-plugin-updater.php (added)
-
tags/1.9.9/includes/license (added)
-
tags/1.9.9/includes/license/class-bnfw-license-setting.php (added)
-
tags/1.9.9/includes/license/class-bnfw-license.php (added)
-
tags/1.9.9/includes/notification (added)
-
tags/1.9.9/includes/notification/post-notification.php (added)
-
tags/1.9.9/includes/overrides.php (added)
-
tags/1.9.9/languages (added)
-
tags/1.9.9/languages/bnfw-de_DE.mo (added)
-
tags/1.9.9/languages/bnfw-de_DE.po (added)
-
tags/1.9.9/languages/bnfw-es_ES.mo (added)
-
tags/1.9.9/languages/bnfw-es_ES.po (added)
-
tags/1.9.9/languages/bnfw-fr_FR.mo (added)
-
tags/1.9.9/languages/bnfw-fr_FR.po (added)
-
tags/1.9.9/languages/bnfw-nl_NL.mo (added)
-
tags/1.9.9/languages/bnfw-nl_NL.po (added)
-
tags/1.9.9/languages/bnfw-pt_BR.mo (added)
-
tags/1.9.9/languages/bnfw-pt_BR.po (added)
-
tags/1.9.9/languages/bnfw.pot (added)
-
tags/1.9.9/vendor (added)
-
tags/1.9.9/vendor/persist-admin-notices-dismissal (added)
-
tags/1.9.9/vendor/persist-admin-notices-dismissal/CHANGES.md (added)
-
tags/1.9.9/vendor/persist-admin-notices-dismissal/README.md (added)
-
tags/1.9.9/vendor/persist-admin-notices-dismissal/composer.json (added)
-
tags/1.9.9/vendor/persist-admin-notices-dismissal/dismiss-notice.js (added)
-
tags/1.9.9/vendor/persist-admin-notices-dismissal/persist-admin-notices-dismissal.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/bnfw.php (modified) (23 diffs)
-
trunk/includes/admin/class-bnfw-notification.php (modified) (3 diffs)
-
trunk/includes/engine/class-bnfw-engine.php (modified) (14 diffs)
-
trunk/includes/helpers/helpers.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bnfw/trunk/README.txt
r3240554 r3350070 4 4 Tags: notification, email, alert, message, notify 5 5 Requires at least: 4.8 6 Tested up to: 6. 66 Tested up to: 6.8 7 7 Requires PHP: 7.4 8 Stable tag: "1.9. 8"8 Stable tag: "1.9.9" 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 250 250 == Changelog == 251 251 252 = 1.9.9 - 26th August 2025 = 253 * Fixed: The `[email_change_confirmation_link]` shortcode link now respects being overridden correctly. 254 * Fixed: Escaping in various shortcodes. 255 * Fixed: Issue where non-English dates added via shortcodes still showed in English. 256 * Fixed: Issue where a category or taxonomy term associated with a notification had been deleted. 257 * Added: Support for the upcoming Multi-language Add-on. 258 252 259 = 1.9.8 - 5th November 2024 = 253 260 * Added: Support for the new 'Send Notification Only Once' feature in the [Digest add-on](https://betternotificationsforwp.com/downloads/digest/). -
bnfw/trunk/bnfw.php
r3240554 r3350070 4 4 * Plugin URI: https://wordpress.org/plugins/bnfw/ 5 5 * Description: Supercharge your WordPress notifications using a WYSIWYG editor and shortcodes. Default and new notifications available. Add more power with Add-ons. 6 * Version: 1.9. 86 * Version: 1.9.9 7 7 * Requires at least: 4.8 8 8 * Requires PHP: 7.4 … … 41 41 * @var string 42 42 */ 43 public $bnfw_version = '1.9. 8';43 public $bnfw_version = '1.9.9'; 44 44 /** 45 45 * Class Constructor. … … 269 269 $args['subject'] = $subject; 270 270 } 271 272 /** 273 * Filters the subject of the email sent when a change of user email address is attempted. 274 * 275 * @param array $args An array of email TO, Subject, Message and Header. 276 * @param array $setting Notification settings. 277 * 278 * @since 1.9.9 279 */ 280 $args = apply_filters( 'bnfw_user_on_email_change_request_subject', $args, $setting ); 271 281 } 272 282 … … 733 743 * @since 1.1 734 744 * 735 * @param string $title Email subject.736 * @param string $user_login The username for the user.737 * @param string$user_data WP_User object.745 * @param string $title Email subject. 746 * @param string $user_login The username for the user. 747 * @param WP_User $user_data WP_User object. 738 748 * 739 749 * @return string … … 745 755 // If there are multiple notification then we will read data about only the last one. 746 756 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 747 748 if ( '' === $user_data ) { 749 return $this->engine->handle_shortcodes( $setting['subject'], 'user-password', $user_data->ID ); 750 } else { 751 return $this->engine->handle_shortcodes( $setting['subject'], 'user-password', $user_data->ID ); 752 } 757 $user_id = ! empty( $user_data->ID ) ? $user_data->ID : 0; 758 759 $title = $this->engine->handle_shortcodes( $setting['subject'], 'user-password', $user_id ); 760 761 /** 762 * Filters the subject of the password reset email. 763 * 764 * @since 1.9.9 765 * 766 * @param string $title Email subject. 767 * @param array $setting Notification settings. 768 * @param string $user_login The username for the user. 769 * @param WP_User $user_data WP_User object. 770 */ 771 $title = apply_filters( 'bnfw_user_retrieve_password_title', $title, $setting, $user_login, $user_data ); 753 772 } 754 773 … … 761 780 * @since 1.1 762 781 * 763 * @param string $message Email message.764 * @param string $key The activation key.765 * @param string $user_login The username for the user.766 * @param string$user_data WP_User object.782 * @param string $message Email message. 783 * @param string $key The activation key. 784 * @param string $user_login The username for the user. 785 * @param WP_User $user_data WP_User object. 767 786 * 768 787 * @return string … … 774 793 // If there are multiple notification then we will read data about only the last one. 775 794 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 795 796 /** 797 * Filters the override the notification settings. 798 * 799 * @param array $setting Notification settings. 800 * @param WP_User $user_data WP_User object. 801 * 802 * @since 1.9.9 803 */ 804 $setting = apply_filters( 'bnfw_change_password_email_message_notification_settings', $setting, $user_data ); 776 805 777 806 $message = $this->engine->handle_password_reset_shortcodes( $setting, $key, $user_login, $user_data ); … … 912 941 return $email_data; 913 942 } 943 914 944 /** 915 945 * Filters the text of the email sent when a change of user email address is attempted. … … 934 964 // If there are multiple notification then we will read data about only the last one. 935 965 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 966 967 /** 968 * Filters the override notification settings. 969 * 970 * @param array $setting Notification settings. 971 * @param WP_User $user Current WP_User instance. 972 * @param array $new_user_details { 973 * Data relating to the new user email address. 974 * 975 * @type string $hash The secure hash used in the confirmation link URL. 976 * @type string $newemail The proposed new email address. 977 * } 978 * 979 * @since 1.9.9 980 */ 981 $setting = apply_filters( 'bnfw_user_on_email_changing_notification_settings', $setting, $user, $new_user_details ); 936 982 937 983 // Ensures the content type of the message. … … 944 990 $email_text = $this->engine->handle_shortcodes( $setting['message'], $setting['notification'], $new_user_details['newemail'] ); 945 991 $email_text = $this->engine->handle_global_user_shortcodes( $email_text, $new_user_details['newemail'] ); 946 $email_text = str_replace( '[email_change_confirmation_link]', esc_url( admin_url( 'profile.php?newuseremail=' . $new_user_details['hash'] ) ), $email_text );992 $email_text = str_replace( '[email_change_confirmation_link]', esc_url( self_admin_url( 'profile.php?newuseremail=' . $new_user_details['hash'] ) ), $email_text ); 947 993 $email_text = str_replace( '[user_nicename]', $user->data->user_nicename, $email_text ); 948 994 $email_text = str_replace( '[user_id]', $user->data->ID, $email_text ); … … 1034 1080 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 1035 1081 1082 /** 1083 * Filters the override the notification settings. 1084 * 1085 * @param array $setting Notification settings. 1086 * @param array $email_data Email Data. 1087 * @param string|int $extra_data Extra data like ID of user. 1088 * 1089 * @since 1.9.9 1090 */ 1091 $setting = apply_filters( 'bnfw_handle_filtered_data_notification_settings', $setting, $email_data, $extra_data ); 1092 1036 1093 // Ensures the content type of the message. 1037 1094 if ( 'html' === $setting['email-formatting'] ) { … … 1153 1210 * 1154 1211 * @since 1.6.5 1212 * @since 1.9.9 Added `$user_id` parameter. 1155 1213 */ 1156 if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, $new_role, $old_roles ) ) {1214 if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, $new_role, $old_roles, $user_id ) ) { 1157 1215 $this->engine->send_user_role_changed_email( $this->notifier->read_settings( $notification->ID ), $user_id, $old_roles[0], $new_role ); 1158 1216 } … … 1165 1223 * 1166 1224 * @since 1.6.5 1225 * @since 1.9.9 Added `$user_id` parameter. 1167 1226 */ 1168 if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, $new_role, $old_roles ) ) {1227 if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, $new_role, $old_roles, $user_id ) ) { 1169 1228 $setting = $this->notifier->read_settings( $notification->ID ); 1170 1229 $setting['message'] = $this->engine->handle_user_role_shortcodes( $setting['message'], $old_roles[0], $new_role ); … … 1199 1258 1200 1259 foreach ( $notifications as $notification ) { 1201 if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, $new_role, null ) ) {1260 if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, $new_role, null, $user_id ) ) { 1202 1261 $this->engine->send_user_role_changed_email( $this->notifier->read_settings( $notification->ID ), $user_id, null, $new_role ); 1203 1262 } … … 1206 1265 $notifications_admin = $this->notifier->get_notifications( 'admin-role' ); 1207 1266 foreach ( $notifications_admin as $notification ) { 1208 if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, $new_role, null ) ) {1267 if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, $new_role, null, $user_id ) ) { 1209 1268 $setting = $this->notifier->read_settings( $notification->ID ); 1210 1269 $setting['message'] = $this->engine->handle_user_role_shortcodes( $setting['message'], null, $new_role ); … … 1238 1297 1239 1298 foreach ( $notifications as $notification ) { 1240 if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, null, array( $old_role ) ) ) {1299 if ( apply_filters( 'bnfw_trigger_user-role_notification', true, $notification, null, array( $old_role ), $user_id ) ) { 1241 1300 $this->engine->send_user_role_changed_email( $this->notifier->read_settings( $notification->ID ), $user_id, $old_role, null ); 1242 1301 } … … 1245 1304 $notifications_admin = $this->notifier->get_notifications( 'admin-role' ); 1246 1305 foreach ( $notifications_admin as $notification ) { 1247 if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, null, array( $old_role ) ) ) {1306 if ( apply_filters( 'bnfw_trigger_admin-role_notification', true, $notification, null, array( $old_role ), $user_id ) ) { 1248 1307 $setting = $this->notifier->read_settings( $notification->ID ); 1249 1308 $setting['message'] = $this->engine->handle_user_role_shortcodes( $setting['message'], $old_role, null ); … … 1285 1344 * 1286 1345 * @since 1.6.5 1346 * @since 1.9.9 Added `$user_id` parameter. 1287 1347 */ 1288 if ( apply_filters( 'bnfw_trigger_user-role-added_notification', true, $notification, $new_roles, $old_roles ) ) {1348 if ( apply_filters( 'bnfw_trigger_user-role-added_notification', true, $notification, $new_roles, $old_roles, $user_id ) ) { 1289 1349 $this->engine->send_user_role_added_email( $this->notifier->read_settings( $notification->ID ), $user_id, $old_roles, $new_roles ); 1290 1350 } … … 1298 1358 * 1299 1359 * @since 1.6.5 1360 * @since 1.9.9 Added `$user_id` parameter. 1300 1361 */ 1301 if ( apply_filters( 'bnfw_trigger_ user-role-added_notification', true, $notification, $new_roles, $old_roles) ) {1362 if ( apply_filters( 'bnfw_trigger_admin-role-added_notification', true, $notification, $new_roles, $old_roles, $user_id ) ) { 1302 1363 $setting = $this->notifier->read_settings( $notification->ID ); 1303 1364 $setting['message'] = $this->engine->handle_user_added_role_shortcodes( $setting['message'], $old_roles, $new_roles ); … … 1500 1561 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 1501 1562 1563 /** 1564 * Filters the text of the email sent with a personal data export file. 1565 * 1566 * @param array $setting Setting of the notification. 1567 * @param array $email_data Data relating to the account action email. 1568 * 1569 * @since 1.9.9 1570 */ 1571 $setting = apply_filters( 'bnfw_handle_data_export_email_content_settings', $setting, $email_data ); 1572 1502 1573 $new_content = $this->engine->handle_data_export_email_shortcodes( $setting[ $field ], $setting, $request_id ); 1503 1574 $new_content = $this->engine->handle_global_user_shortcodes( $new_content, $email_data['message_recipient'] ); … … 1547 1618 // Ideally there should be only one notification for this type. 1548 1619 // If there are multiple notification then we will read data about only the last one. 1549 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 1620 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 1621 1622 /** 1623 * Filters the subject of the email sent when an erasure request is completed. 1624 * 1625 * @param array $setting Setting of the notification. 1626 * @param array $email_data Data relating to the account action email. 1627 * 1628 * @since 1.9.9 1629 */ 1630 $setting = apply_filters( 'bnfw_handle_erasure_complete_email_notification_settings', $setting, $email_data ); 1631 1550 1632 $new_content = $this->engine->handle_shortcodes( $setting[ $field ], $notification_name, $email_data ); 1551 1633 } … … 1623 1705 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 1624 1706 1707 /** 1708 * Filters the text of the email sent when an account action is attempted. 1709 * 1710 * @param array $setting Setting of the notification. 1711 * @param array $email_data Data relating to the account action email. 1712 * 1713 * @since 1.9.9 1714 */ 1715 $setting = apply_filters( 'bnfw_handle_user_request_notification_settings', $setting, $email_data ); 1716 1625 1717 return $this->engine->handle_user_request_email_shortcodes( $setting[ $field ], $setting, $email_data ); 1626 1718 } … … 1645 1737 $setting = $this->notifier->read_settings( end( $notifications )->ID ); 1646 1738 1739 /** 1740 * Filters the body of the user request confirmation email. 1741 * 1742 * @param array $setting Setting of the notification. 1743 * @param array $email_data Data relating to the account action email. 1744 * 1745 * @since 1.9.9 1746 */ 1747 $setting = apply_filters( 'bnfw_handle_user_confirmed_action_notification_settings', $setting, $email_data ); 1748 1647 1749 return $this->engine->handle_user_confirmed_action_email_shortcodes( $setting[ $field ], $setting, $email_data ); 1648 1750 } -
bnfw/trunk/includes/admin/class-bnfw-notification.php
r3182351 r3350070 710 710 </table> 711 711 <?php 712 /** 713 * Fires after render all notification setting fields. 714 * 715 * @param array $setting Notification settings. 716 * 717 * @since 1.9.9 718 */ 719 do_action( 'bnfw_after_setting_fields', $setting ); 712 720 } 713 721 … … 1015 1023 </div> 1016 1024 1017 <br> 1018 <br> 1025 <?php 1026 /** 1027 * Fires after notification meta setting fields. 1028 * 1029 * @param array $setting Notification settings. 1030 * 1031 * @since 1.9.9 1032 */ 1033 do_action( 'bnfw_after_notification_disabled_field', $setting ); 1034 ?> 1019 1035 1020 1036 <?php if ( 'publish' === $post->post_status ) { ?> … … 1188 1204 $columns['excluded'] = esc_html__( 'Excluded User Roles / Users', 'bnfw' ); 1189 1205 1190 return $columns; 1206 /** 1207 * Invoked while displaying a custom column in the notification table. 1208 * 1209 * @param array $column Array of column names. 1210 * 1211 * @since 1.9.9 1212 */ 1213 return apply_filters( 'bnfw_notification_table_columns', $columns ); 1191 1214 } 1192 1215 -
bnfw/trunk/includes/engine/class-bnfw-engine.php
r3110258 r3350070 74 74 } 75 75 76 77 76 $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $id ); 78 77 $message = $this->handle_shortcodes( $setting['message'], $setting['notification'], $id ); … … 104 103 if ( isset( $emails['to'] ) && is_array( $emails['to'] ) ) { 105 104 foreach ( $emails['to'] as $email ) { 106 wp_mail( $email, stripslashes( $this->handle_global_user_shortcodes( $subject, $email ) ), $this->handle_global_user_shortcodes( $message, $email ), $headers ); 105 106 $subject = wp_specialchars_decode( stripslashes( $this->handle_global_user_shortcodes( $subject, $email ) ) ); 107 $message = $this->handle_global_user_shortcodes( $message, $email ); 108 109 /** 110 * Filter to apply before send notification to user. 111 * 112 * @param bool $is_send Boolean. Default true. 113 * @param int $id ID. 114 * @param string $email Email of user. 115 * @param array $setting Notification settings. 116 * @param string $subject Notification subject. 117 * @param string $message Notification content. 118 * @param string|string[] $headers Additional headers. 119 * 120 * @since 1.9.9 121 */ 122 if ( apply_filters( 'bnfw_can_send_user_locale_email', true, $id, $email, $setting, $subject, $message, $headers ) ) { 123 wp_mail( $email, $subject, $message, $headers ); 124 } 107 125 } 108 126 } … … 124 142 * 125 143 * @since 1.7 144 * @since 1.9.9 Added `$password_url` parameter. 126 145 */ 127 $trigger_notification = apply_filters( 'bnfw_trigger_welcome-email_notification', true, $setting, $user );146 $trigger_notification = apply_filters( 'bnfw_trigger_welcome-email_notification', true, $setting, $user, $password_url ); 128 147 129 148 if ( ! $trigger_notification ) { … … 165 184 $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email ); 166 185 $message = $this->handle_global_user_shortcodes( $message, $user->user_email ); 167 wp_mail( $user->user_email, stripslashes( $subject), $message, $headers );186 wp_mail( $user->user_email, wp_specialchars_decode( stripslashes( $subject ) ), $message, $headers ); 168 187 } 169 188 … … 205 224 $message = $this->handle_global_user_shortcodes( $message, $user->user_email ); 206 225 207 wp_mail( $user->user_email, stripslashes( $subject), $message, $headers );226 wp_mail( $user->user_email, wp_specialchars_decode( stripslashes( $subject ) ), $message, $headers ); 208 227 } 209 228 … … 246 265 $notification_disabled = apply_filters( 'bnfw_notification_disabled', false, $comment_id, $setting ); 247 266 248 if ( ! $notification_disabled ) { 267 /** 268 * Filter to apply before send notification to user. 269 * 270 * @param bool $is_send Boolean. Default true. 271 * @param int $comment_id Comment ID. 272 * @param array $setting Notification settings. 273 * @param object $parent_comment Parent comment object. 274 * 275 * @since 1.9.9 276 */ 277 if ( ! $notification_disabled && apply_filters( 'bnfw_trigger_comments_reply_notification', true, $comment_id, $setting, $parent_comment ) ) { 249 278 $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $comment_id ); 250 279 $message = $this->handle_shortcodes( $setting['message'], $setting['notification'], $comment_id ); … … 262 291 $subject = $this->handle_global_user_shortcodes( $subject, $parent_comment->comment_author_email ); 263 292 $message = $this->handle_global_user_shortcodes( $message, $parent_comment->comment_author_email ); 264 wp_mail( $parent_comment->comment_author_email, stripslashes( $subject), $message, $headers );293 wp_mail( $parent_comment->comment_author_email, wp_specialchars_decode( stripslashes( $subject ) ), $message, $headers ); 265 294 } 266 295 } … … 298 327 $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email ); 299 328 $message = $this->handle_global_user_shortcodes( $message, $user->user_email ); 300 wp_mail( $user->user_email, stripslashes( $subject), $message, $headers );329 wp_mail( $user->user_email, wp_specialchars_decode( stripslashes( $subject ) ), $message, $headers ); 301 330 } 302 331 … … 335 364 $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email ); 336 365 $message = $this->handle_global_user_shortcodes( $message, $user->user_email ); 337 wp_mail( $user->user_email, stripslashes( $subject), $message, $headers );366 wp_mail( $user->user_email, wp_specialchars_decode( stripslashes( $subject ) ), $message, $headers ); 338 367 } 339 368 … … 444 473 */ 445 474 public function handle_core_updated_notification( $email_data, $setting, $type ) { 475 476 $emails = $this->get_emails( $setting, $type ); 477 $headers = $this->get_headers( $emails ); 478 479 /** 480 * Filters the contents of the email sent when core updated. 481 * 482 * @param array $setting Notification settings. 483 * @param array $email_data Used to build wp_mail(). 484 * @param array $emails Email addresses to send email. 485 * @param string $type Result of update. 486 * 487 * @since 1.9.9 488 */ 489 $setting = apply_filters( 'bnfw_handle_core_updated_notification', $setting, $email_data, $emails, $type ); 490 446 491 $email_data['body'] = $this->handle_shortcodes( $setting['message'], $setting['notification'], $type ); 447 492 $email_data['subject'] = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $type ); 448 449 $emails = $this->get_emails( $setting, $type );450 $headers = $this->get_headers( $emails );451 493 452 494 $email_data['body'] = $this->handle_global_user_shortcodes( $email_data['body'], $emails['to'][0] ); … … 474 516 * Handle shortcode for password reset email message. 475 517 * 476 * @param string$setting Notification settings.477 * @param string $key The activation key.478 * @param string $user_login The username for the user.518 * @param array $setting Notification settings. 519 * @param string $key The activation key. 520 * @param string $user_login The username for the user. 479 521 * @param WP_User $user_data WP_User object. 480 522 * 481 523 * @return mixed|string 482 524 * @since 1.1 483 *484 525 */ 485 526 public function handle_password_reset_shortcodes( $setting, $key, $user_login, $user_data ) { … … 506 547 public function send_password_changed_email( $setting, $user ) { 507 548 $user_id = $user->ID; 549 550 /** 551 * Filters the Send Password Changed email. 552 * 553 * @param array $setting Notification settings. 554 * @param WP_User $user WP_User object. 555 * 556 * @since 1.9.9 557 */ 558 $setting = apply_filters( 'bnfw_user_send_password_changed_email', $setting, $user ); 508 559 509 560 $subject = $this->handle_shortcodes( $setting['subject'], $setting['notification'], $user_id ); … … 523 574 $subject = $this->handle_global_user_shortcodes( $subject, $user->user_email ); 524 575 $message = $this->handle_global_user_shortcodes( $message, $user->user_email ); 525 wp_mail( $user->user_email, stripslashes( $subject), $message, $headers );576 wp_mail( $user->user_email, wp_specialchars_decode( stripslashes( $subject ) ), $message, $headers ); 526 577 } 527 578 … … 844 895 $message = str_replace( '[post_category]', implode( ', ', wp_list_pluck( $categories, 'name' ) ), $message ); 845 896 846 if ( count( $categories ) > 0 ) {897 if ( ! is_wp_error( $categories ) && count( $categories ) > 0 ) { 847 898 $message = str_replace( 848 899 array( -
bnfw/trunk/includes/helpers/helpers.php
r3110258 r3350070 247 247 $time_format = get_option( 'time_format' ); 248 248 249 return date ( $date_format . ' ' . $time_format, strtotime( $date ) );249 return date_i18n( $date_format . ' ' . $time_format, strtotime( $date ) ); 250 250 } 251 251 }
Note: See TracChangeset
for help on using the changeset viewer.