WordPress.org

Make WordPress Core

Ticket #20007: wp-reg-notify-option-patch.diff

File wp-reg-notify-option-patch.diff, 3.8 KB (added by Veraxus, 2 years ago)

Patch that adds registration notification option to WP (svn diff)

  • wp-admin/includes/schema.php

     
    387387        'links_recently_updated_time' => 120, 
    388388        'comment_moderation' => 0, 
    389389        'moderation_notify' => 1, 
     390        'registration_notify' => 1, 
    390391        'permalink_structure' => '', 
    391392        'gzipcompression' => 0, 
    392393        'hack_file' => 0, 
  • wp-admin/options-discussion.php

     
    120120<tr valign="top"> 
    121121<th scope="row"><?php _e('E-mail me whenever'); ?></th> 
    122122<td><fieldset><legend class="screen-reader-text"><span><?php _e('E-mail me whenever'); ?></span></legend> 
     123<label for="registration_notify"> 
     124<input name="registration_notify" type="checkbox" id="registration_notify" value="1" <?php checked('1', get_option('registration_notify')); ?> /> 
     125<?php _e('Somebody registers'); ?> </label> 
     126<br /> 
    123127<label for="comments_notify"> 
    124128<input name="comments_notify" type="checkbox" id="comments_notify" value="1" <?php checked('1', get_option('comments_notify')); ?> /> 
    125129<?php _e('Anyone posts a comment'); ?> </label> 
  • wp-admin/options.php

     
    6060 
    6161$whitelist_options = array( 
    6262        'general' => array( 'blogname', 'blogdescription', 'gmt_offset', 'date_format', 'time_format', 'start_of_week', 'timezone_string' ), 
    63         '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' ), 
     63        'discussion' => array( 'default_pingback_flag', 'default_ping_status', 'default_comment_status', 'registration_notify','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' ), 
    6464        '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', 'embed_autourls', 'embed_size_w', 'embed_size_h' ), 
    6565        'privacy' => array( 'blog_public' ), 
    6666        'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ), 
  • wp-includes/pluggable.php

     
    11931193        $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n"; 
    11941194        $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n"; 
    11951195 
    1196         @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message); 
    1197  
     1196        if ( 1 == get_option( 'registration_notify' ) ) { 
     1197            @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message); 
     1198        } 
     1199         
    11981200        if ( empty($plaintext_pass) ) 
    11991201                return; 
    12001202