Ticket #9137: annoying_emails.diff
| File annoying_emails.diff, 4.8 KB (added by sirzooro, 4 years ago) |
|---|
-
wp-admin/includes/schema.php
diff -Naur ori/wp-admin/includes/schema.php new/wp-admin/includes/schema.php
ori new 186 186 add_option('blogdescription', __('Just another WordPress weblog')); 187 187 add_option('users_can_register', 0); 188 188 add_option('admin_email', 'you@example.com'); 189 add_option('send_annoying_emails_to_admin', 1); 189 190 add_option('start_of_week', 1); 190 191 add_option('use_balanceTags', 0); 191 192 add_option('use_smilies', 1); -
wp-admin/options-general.php
diff -Naur ori/wp-admin/options-general.php new/wp-admin/options-general.php
ori new 80 80 <span class="setting-description"><?php _e('This address is used for admin purposes, like new user notification.') ?></span></td> 81 81 </tr> 82 82 <tr valign="top"> 83 <th scope="row"><label for="send_annoying_emails_to_admin"><?php _e('Send annoying emails') ?> </label></th> 84 <td><input name="send_annoying_emails_to_admin" type="checkbox" id="send_annoying_emails_to_admin" value="1" <?php checked('1', get_option('send_annoying_emails_to_admin')); ?>" /> 85 <span class="setting-description"><?php _e('Send annoying emails to admin, like new user notification.') ?></span></td> 86 </tr> 87 <tr valign="top"> 83 88 <th scope="row"><?php _e('Membership') ?></th> 84 89 <td> <fieldset><legend class="hidden"><?php _e('Membership') ?></legend><label for="users_can_register"> 85 90 <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_option('users_can_register')); ?> /> -
wp-admin/options.php
diff -Naur ori/wp-admin/options.php new/wp-admin/options.php
ori new 22 22 wp_reset_vars(array('action')); 23 23 24 24 $whitelist_options = array( 25 'general' => array( 'blogname', 'blogdescription', 'admin_email', ' users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role' ),25 'general' => array( 'blogname', 'blogdescription', 'admin_email', 'send_annoying_emails_to_admin', 'users_can_register', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'default_role' ), 26 26 'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'comments_notify', 'moderation_notify', 'comment_moderation', 'require_name_email', 'comment_whitelist', 'comment_max_links', 'moderation_keys', 'blacklist_keys', 'show_avatars', 'avatar_rating', 'avatar_default', 'close_comments_for_old_posts', 'close_comments_days_old', 'thread_comments', 'thread_comments_depth', 'page_comments', 'comments_per_page', 'default_comments_page', 'comment_order', 'comment_registration' ), 27 27 'misc' => array( 'hack_file', 'use_linksupdate', 'uploads_use_yearmonth_folders', 'upload_path', 'upload_url_path' ), 28 28 'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type' ), -
wp-includes/pluggable.php
diff -Naur ori/wp-includes/pluggable.php new/wp-includes/pluggable.php
ori new 1081 1081 function wp_password_change_notification(&$user) { 1082 1082 // send a copy of password change notification to the admin 1083 1083 // but check to see if it's the admin whose password we're changing, and skip this 1084 if ( $user->user_email != get_option('admin_email') ) {1084 if ( ( $user->user_email != get_option('admin_email') ) && get_option('send_annoying_emails_to_admin') ) { 1085 1085 $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n"; 1086 1086 wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message); 1087 1087 } … … 1103 1103 $user_login = stripslashes($user->user_login); 1104 1104 $user_email = stripslashes($user->user_email); 1105 1105 1106 $message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n"; 1107 $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; 1108 $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n"; 1106 if ( get_option('send_annoying_emails_to_admin') ) 1107 { 1108 $message = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n"; 1109 $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; 1110 $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n"; 1109 1111 1110 @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message); 1112 @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message); 1113 } 1111 1114 1112 1115 if ( empty($plaintext_pass) ) 1113 1116 return;
