Skip to:
Content

bbPress.org

Changeset 3912


Ignore:
Timestamp:
05/22/2012 08:28:28 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Redirects:

  • Tweak topic and reply form fields to include redirect_to field.
  • Fix redirect logic in single items after editing.
  • Remove forum_id from new reply hidden fields, and calculate on handler based off of topic ID (to prevent mismatches.)
  • Fixes #1829.
Location:
branches/plugin/bbp-includes
Files:
2 edited

Legend:

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

    r3902 r3912  
    11701170        <input type="hidden" name="bbp_forum_id" id="bbp_forum_id"    value="<?php bbp_forum_id(); ?>" />
    11711171
     1172        <?php bbp_redirect_to_field( bbp_get_forum_permalink( bbp_get_forum_id() ) ); ?>
     1173
    11721174        <?php
    11731175
     
    12191221        <input type="hidden" name="bbp_topic_id" id="bbp_topic_id"    value="<?php bbp_topic_id(); ?>" />
    12201222
     1223        <?php bbp_redirect_to_field( bbp_get_topic_permalink( bbp_get_topic_id() ) ); ?>
     1224
    12211225        <?php
    12221226
     
    12331237
    12341238            <input type="hidden" name="bbp_forum_id" id="bbp_forum_id" value="<?php bbp_forum_id(); ?>" />
    1235 
    1236             <?php bbp_redirect_to_field( get_permalink() ); ?>
    12371239
    12381240        <?php endif; ?>
     
    12671269        <input type="hidden" name="action"          id="bbp_post_action" value="bbp-edit-reply" />
    12681270
     1271        <?php bbp_redirect_to_field( bbp_get_reply_url( bbp_get_reply_id() ) ); ?>
     1272
    12691273        <?php if ( current_user_can( 'unfiltered_html' ) )
    12701274            wp_nonce_field( 'bbp-unfiltered-html-reply_' . bbp_get_reply_id(), '_bbp_unfiltered_html_reply', false ); ?>
     
    12751279
    12761280        <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(); ?>" />
    1277         <input type="hidden" name="bbp_forum_id"    id="bbp_forum_id"    value="<?php bbp_forum_id(); ?>" />
    12781281        <input type="hidden" name="bbp_topic_id"    id="bbp_topic_id"    value="<?php bbp_topic_id(); ?>" />
    12791282        <input type="hidden" name="action"          id="bbp_post_action" value="bbp-new-reply" />
  • branches/plugin/bbp-includes/bbp-reply-functions.php

    r3911 r3912  
    160160    if ( isset( $_POST['bbp_forum_id'] ) ) {
    161161        $forum_id = (int) $_POST['bbp_forum_id'];
     162    } elseif ( !empty( $topic_id ) ) {
     163        $forum_id = bbp_get_topic_forum_id( $topic_id );
    162164    } else {
    163165        bbp_add_error( 'bbp_reply_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) );
Note: See TracChangeset for help on using the changeset viewer.