Skip to:
Content

bbPress.org

Changeset 6504


Ignore:
Timestamp:
06/09/2017 04:27:53 AM (5 years ago)
Author:
johnjamesjacoby
Message:

Topics: Redirect to forum when trashing a topic and the user cannot view trash.

Fixes #3111. Props mattrabe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/topics/functions.php

    r6499 r6504  
    23472347                    $retval['status']      = wp_trash_post( $r['id'] );
    23482348                    $retval['message']     = __( '<strong>ERROR</strong>: There was a problem trashing the topic.', 'bbpress' );
    2349                     $retval['redirect_to'] = bbp_get_topic_permalink( $r['id'] );
     2349                    $retval['redirect_to'] = current_user_can( 'view_trash' )
     2350                        ? bbp_get_topic_permalink( $r['id'] )
     2351                        : bbp_get_forum_permalink( bbp_get_topic_forum_id( $r['id'] ) );
    23502352
    23512353                    break;
Note: See TracChangeset for help on using the changeset viewer.