Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/05/2011 06:20:46 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Introduce forum type/status/visibility using post_meta. This hides the built in WordPress equivalents as a temporary hack until custom WP post statuses are more flexible. Props GautamGupta via Google Code-in.

File:
1 edited

Legend:

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

    r2740 r2746  
    306306                $bbp->errors->add( 'bbp_topic_forum_id', __( '<strong>ERROR</strong>: Forum ID is missing.', 'bbpress' ) );
    307307
     308        if ( bbp_is_forum_category( $forum_id ) )
     309            $bbp->errors->add( 'bbp_topic_forum_category', __( '<strong>ERROR</strong>: This forum is a category. No topics can be created in this forum!', 'bbpress' ) );
     310
     311        if ( bbp_is_forum_closed( $forum_id ) && !current_user_can( 'edit_forum', $forum_id ) )
     312            $bbp->errors->add( 'bbp_topic_forum_closed', __( '<strong>ERROR</strong>: This forum has been closed to new topics!', 'bbpress' ) );
     313
     314        if ( bbp_is_forum_private( $forum_id ) && !current_user_can( 'read_private_forums' ) )
     315            $bbp->errors->add( 'bbp_topic_forum_private', __( '<strong>ERROR</strong>: This forum is private and you do not have the capability to read or create new topics in this forum!', 'bbpress' ) );
     316
    308317        // Check for flood
    309318        if ( !bbp_check_for_flood( $anonymous_data, $topic_author ) )
     
    624633 */
    625634function bbp_pre_get_posts ( $wp_query ) {
    626     global $bbp;
     635    global $bbp, $wp_version;
    627636
    628637    $bbp_user     = get_query_var( 'bbp_user'         );
     
    645654    // Define new query variable
    646655    if ( !empty( $is_user_edit ) ) {
    647         global $wp_version;
    648 
    649656        // Only allow super admins on multisite to edit every user.
    650657        if ( ( is_multisite() && !current_user_can( 'manage_network_users' ) && $user_id != $current_user->ID && ! apply_filters( 'enable_edit_any_user_configuration', true ) ) || !current_user_can( 'edit_user', $user->ID ) )
Note: See TracChangeset for help on using the changeset viewer.