Skip to:
Content

bbPress.org

Changeset 2417


Ignore:
Timestamp:
04/03/2010 03:31:10 PM (16 years ago)
Author:
chrishajer
Message:

Add throttle time setting to Options Writing admin screen. Fixes #1185. Props Nightgunner5, _ck_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bb-admin/options-writing.php

    r2295 r2417  
    33require_once('admin.php');
    44
    5 if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update') {
     5if ( 'post' == strtolower( $_SERVER['REQUEST_METHOD'] ) && $_POST['action'] == 'update' ) {
    66   
    77    bb_check_admin_referer( 'options-writing-update' );
    88   
    99    // Deal with xmlrpc checkbox when it isn't checked
    10     if (!isset($_POST['enable_xmlrpc'])) {
     10    if ( !isset( $_POST['enable_xmlrpc'] ) ) {
    1111        $_POST['enable_xmlrpc'] = false;
    1212    }
    1313   
    1414    foreach ( (array) $_POST as $option => $value ) {
    15         if ( !in_array( $option, array('_wpnonce', '_wp_http_referer', 'action', 'submit') ) ) {
     15        if ( !in_array( $option, array( '_wpnonce', '_wp_http_referer', 'action', 'submit' ) ) ) {
    1616            $option = trim( $option );
    1717            $value = is_array( $value ) ? $value : trim( $value );
     
    2525    }
    2626   
    27     $goback = add_query_arg('updated', 'true', wp_get_referer());
    28     bb_safe_redirect($goback);
     27    $goback = add_query_arg( 'updated', 'true', wp_get_referer() );
     28    bb_safe_redirect( $goback );
    2929    exit;
    3030}
     
    4040        'after' => __( 'minutes' ),
    4141        'note' => __( 'A user can edit a post for this many minutes after submitting.' ),
     42    ),
     43    'throttle_time' => array(
     44        'title' => __( 'Throttle time' ),
     45        'class' => 'short',
     46        'after' => __( 'seconds' ),
     47        'note' => __( 'Users must wait this many seconds between posts. By default, moderators, administrators and keymasters are not throttled.' )
    4248    )
    4349);
     
    6167<div class="wrap">
    6268
    63 <h2><?php _e('Writing Settings'); ?></h2>
     69<h2><?php _e( 'Writing Settings' ); ?></h2>
    6470<?php do_action( 'bb_admin_notices' ); ?>
    6571
     
    6773    <fieldset><?php foreach ( $general_options as $option => $args ) bb_option_form_element( $option, $args ); ?></fieldset>
    6874    <fieldset>
    69         <legend><?php _e('Remote Publishing'); ?></legend>
     75        <legend><?php _e( 'Remote Publishing' ); ?></legend>
    7076        <p>
    7177            <?php _e( 'To interact with bbPress from a desktop client or remote website that uses the XML-RPC publishing interface you must enable it below.' ); ?>
     
    7682        <?php bb_nonce_field( 'options-writing-update' ); ?>
    7783        <input type="hidden" name="action" value="update" />
    78         <input class="submit" type="submit" name="submit" value="<?php _e('Save Changes') ?>" />
     84        <input class="submit" type="submit" name="submit" value="<?php _e( 'Save Changes' ); ?>" />
    7985    </fieldset>
    8086</form>
Note: See TracChangeset for help on using the changeset viewer.