WordPress.org

Make WordPress Core

Ticket #23233: 23233.diff

File 23233.diff, 4.0 KB (added by ericlewis, 8 years ago)
  • wp-admin/options-discussion.php

     
    55 * @package WordPress
    66 * @subpackage Administration
    77 */
    8 
    98/** WordPress Administration Bootstrap */
    109require_once( dirname( __FILE__ ) . '/admin.php' );
    1110
     
    132131</fieldset></td>
    133132</tr>
    134133<tr valign="top">
    135 <th scope="row"><?php _e('Before a comment appears'); ?></th>
    136 <td><fieldset><legend class="screen-reader-text"><span><?php _e('Before a comment appears'); ?></span></legend>
    137 <label for="comment_moderation">
    138 <input name="comment_moderation" type="checkbox" id="comment_moderation" value="1" <?php checked('1', get_option('comment_moderation')); ?> />
    139 <?php _e('Comment must be manually approved'); ?> </label>
    140 <br />
    141 <label for="comment_whitelist"><input type="checkbox" name="comment_whitelist" id="comment_whitelist" value="1" <?php checked('1', get_option('comment_whitelist')); ?> /> <?php _e('Comment author must have a previously approved comment'); ?></label>
    142 </fieldset></td>
    143 </tr>
    144 <tr valign="top">
    145134<th scope="row"><?php _e('Comment Moderation'); ?></th>
    146135<td><fieldset><legend class="screen-reader-text"><span><?php _e('Comment Moderation'); ?></span></legend>
     136<label for="comment_moderation_manually_approved">
     137        <input name="comment_moderation" id="comment_moderation_manually_approved" type="radio" value="manually_approve" <?php checked( 'manually_approve', get_option( 'comment_moderation' ) ) ?> />
     138        <?php _e( 'All comments must be manually approved' ); ?>
     139</label>
     140<br />
     141<label for="comment_moderation_whitelist_previous_commenters">
     142        <input name="comment_moderation" id="comment_moderation_whitelist_previous_commenters" type="radio" value="whitelist_previous_commenters" <?php checked( 'whitelist_previous_commenters', get_option( 'comment_moderation' ) ) ?> />
     143        <?php _e( 'Only comments by new commenters must be approved' ); ?>
     144</label>
     145<br />
     146<label for="comment_moderation_approve_all">
     147        <input name="comment_moderation" id="comment_moderation_approve_all" type="radio" value="approve_all" <?php checked( 'approve_all', get_option( 'comment_moderation' ) ) ?> />
     148        <?php _e( 'All comments are automatically approved' ); ?>
     149</label>
    147150<p><label for="comment_max_links"><?php printf(__('Hold a comment in the queue if it contains %s or more links. (A common characteristic of comment spam is a large number of hyperlinks.)'), '<input name="comment_max_links" type="number" step="1" min="0" id="comment_max_links" value="' . esc_attr(get_option('comment_max_links')) . '" class="small-text" />' ); ?></label></p>
    148151
    149152<p><label for="moderation_keys"><?php _e('When a comment contains any of these words in its content, name, URL, e-mail, or IP, it will be held in the <a href="edit-comments.php?comment_status=moderated">moderation queue</a>. One word or IP per line. It will match inside words, so &#8220;press&#8221; will match &#8220;WordPress&#8221;.'); ?></label></p>
  • wp-admin/includes/upgrade.php

     
    402402        if ( $wp_current_db_version < 22422 )
    403403                upgrade_350();
    404404
     405        if ( $wp_current_db_version < 25448 )
     406                upgrade_comment_moderation_option();
     407
    405408        maybe_disable_link_manager();
    406409
    407410        maybe_disable_automattic_widgets();
     
    12091212}
    12101213
    12111214/**
     1215 * Temporary function to be rolled into next upgrade_{next_major_version}() function.
     1216 */
     1217function upgrade_comment_moderation_option() {
     1218        if ( get_option( 'comment_moderation' ) )
     1219                update_option( 'comment_moderation', 'manually_approve' );
     1220        else if ( get_option( 'comment_whitelist' ) )
     1221                update_option( 'comment_moderation', 'whitelist_previous_commenters' );
     1222        else
     1223                update_option( 'comment_moderation', 'approve_all' );
     1224        delete_option( 'comment_whitelist' );
     1225}
     1226
     1227/**
    12121228 * Execute network level changes
    12131229 *
    12141230 * @since 3.0.0