Skip to:
Content

bbPress.org


Ignore:
Timestamp:
11/14/2011 03:50:25 AM (11 years ago)
Author:
johnjamesjacoby
Message:

Introduce bbp_template_redirect() and use for checking various edit screens:

  • Introduce bbp_check_forum_edit() to check for forum edit
  • Introduce bbp_check_topic_edit() to check for topic edit
  • Introduce bbp_check_reply_edit() to check for reply edit
  • Introduce bbp_check_topic_tag_edit() to check for topic tag edit
  • Introduce bbp_check_user_edit() to check for user edit
  • Remove these checks from bbp_pre_get_posts() and only use it to setup query vars
  • Fixes #1684, r3605
  • For 2.1 (plugin) branch
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-core-compatibility.php

    r3601 r3607  
    16851685        if ( !empty( $is_edit ) ) {
    16861686
    1687             // Only allow super admins on multisite to edit every user.
    1688             if ( !is_user_logged_in() || ( is_multisite() && !current_user_can( 'manage_network_users' ) && ( $user->ID != bbp_get_current_user_id() ) && !apply_filters( 'enable_edit_any_user_configuration', true ) ) || !current_user_can( 'edit_user', $user->ID ) ) {
    1689                 wp_die( __( 'You do not have permission to edit this user.', 'bbpress' ) );
    1690             }
    1691 
    16921687            // We are editing a profile
    16931688            $posts_query->bbp_is_single_user_edit = true;
     
    17481743    // Topic/Reply Edit Page
    17491744    } elseif ( !empty( $is_edit ) ) {
    1750 
    1751         // Bail from edit if user is not logged in
    1752         if ( !is_user_logged_in() )
    1753             return;
    17541745
    17551746        // Get the post type from the main query loop
Note: See TracChangeset for help on using the changeset viewer.