Skip to:
Content

bbPress.org

Changeset 3748


Ignore:
Timestamp:
02/19/2012 12:09:45 AM (10 years ago)
Author:
johnjamesjacoby
Message:

Use bbp_redirect_to_field() in form_fields() functions. See #1669.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-common-template.php

    r3747 r3748  
    864864    // Remove loggedout query arg if it's there
    865865    $redirect_to    = (string) esc_attr( remove_query_arg( 'loggedout', $redirect_to ) );
    866     $redirect_field = '<input type="hidden" name="redirect_to" value="' . $redirect_to . '" />';
     866    $redirect_field = '<input type="hidden" id="bbp_redirect_to" name="redirect_to" value="' . $redirect_to . '" />';
    867867
    868868    echo apply_filters( 'bbp_redirect_to_field', $redirect_field, $redirect_to );
     
    12211221            <input type="hidden" name="bbp_forum_id" id="bbp_forum_id" value="<?php bbp_forum_id(); ?>" />
    12221222
     1223            <?php bbp_redirect_to_field( get_permalink() ); ?>
     1224
    12231225        <?php endif; ?>
    12241226
    12251227        <input type="hidden" name="action" id="bbp_post_action" value="bbp-new-topic" />
    12261228
    1227         <?php
    1228 
    1229         if ( current_user_can( 'unfiltered_html' ) )
    1230             wp_nonce_field( 'bbp-unfiltered-html-topic_new', '_bbp_unfiltered_html_topic', false );
    1231 
    1232         ?>
     1229        <?php if ( current_user_can( 'unfiltered_html' ) )
     1230            wp_nonce_field( 'bbp-unfiltered-html-topic_new', '_bbp_unfiltered_html_topic', false ); ?>
    12331231
    12341232        <?php wp_nonce_field( 'bbp-new-topic' );
     
    12501248function bbp_reply_form_fields() {
    12511249
    1252     if ( bbp_is_reply_edit() ) { ?>
     1250    if ( bbp_is_reply_edit() ) : ?>
    12531251
    12541252        <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?>" maxlength="<?php bbp_get_title_max_length(); ?>" />
     
    12561254        <input type="hidden" name="action"          id="bbp_post_action" value="bbp-edit-reply" />
    12571255
    1258         <?php
    1259 
    1260         if ( current_user_can( 'unfiltered_html' ) )
    1261             wp_nonce_field( 'bbp-unfiltered-html-reply_' . bbp_get_reply_id(), '_bbp_unfiltered_html_reply', false );
    1262 
    1263         ?>
     1256        <?php if ( current_user_can( 'unfiltered_html' ) )
     1257            wp_nonce_field( 'bbp-unfiltered-html-reply_' . bbp_get_reply_id(), '_bbp_unfiltered_html_reply', false ); ?>
    12641258
    12651259        <?php wp_nonce_field( 'bbp-edit-reply_' . bbp_get_reply_id() );
    12661260
    1267     } else {
    1268 
    1269     ?>
     1261    else : ?>
    12701262
    12711263        <input type="hidden" name="bbp_reply_title" id="bbp_reply_title" value="<?php printf( __( 'Reply To: %s', 'bbpress' ), bbp_get_topic_title() ); ?>" maxlength="<?php bbp_get_title_max_length(); ?>" />
     
    12741266        <input type="hidden" name="action"          id="bbp_post_action" value="bbp-new-reply" />
    12751267
    1276         <?php
    1277 
    1278         if ( current_user_can( 'unfiltered_html' ) )
    1279             wp_nonce_field( 'bbp-unfiltered-html-reply_' . bbp_get_topic_id(), '_bbp_unfiltered_html_reply', false );
    1280 
    1281         ?>
    1282 
    1283         <?php
    1284 
    1285         wp_nonce_field( 'bbp-new-reply' );
     1268        <?php if ( current_user_can( 'unfiltered_html' ) )
     1269            wp_nonce_field( 'bbp-unfiltered-html-reply_' . bbp_get_topic_id(), '_bbp_unfiltered_html_reply', false ); ?>
     1270
     1271        <?php wp_nonce_field( 'bbp-new-reply' );
    12861272
    12871273        // Show redirect field if not viewing a specific topic
    1288         if ( bbp_is_query_name( 'bbp_single_topic' ) ) : ?>
    1289 
    1290             <input type="hidden" name="redirect_to" id="bbp_redirect_to" value="<?php the_permalink(); ?>" />
    1291 
    1292         <?php endif;
    1293 
    1294     }
     1274        if ( bbp_is_query_name( 'bbp_single_topic' ) ) :
     1275            bbp_redirect_to_field( get_permalink() );
     1276
     1277        endif;
     1278    endif;
    12951279}
    12961280
Note: See TracChangeset for help on using the changeset viewer.