Skip to:
Content

bbPress.org

Changeset 3221


Ignore:
Timestamp:
05/25/2011 08:39:20 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Allow Topic Form shortcode to work on pages or any other single template. Fixes #1535.

File:
1 edited

Legend:

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

    r3200 r3221  
    12001200        if ( current_user_can( 'edit_topic', bbp_get_topic_id() ) )
    12011201            $retval = true;
     1202
     1203    // Fallback for shortcodes
     1204    } elseif ( is_page() || is_single() ) {
     1205
     1206        // Page or single post, and user can publish topics or anonymous
     1207        // posting is allowed.
     1208        if ( current_user_can( 'publish_topics' ) || ( !is_user_logged_in() && bbp_allow_anonymous() ) )
     1209            $retval = true;
     1210
    12021211    }
    12031212
     
    12451254        if ( current_user_can( 'edit_forum', bbp_get_topic_forum_id() ) )
    12461255            $retval = true;
     1256
     1257    // Fallback for shortcodes
     1258    } elseif ( is_page() || is_single() ) {
     1259
     1260        // Page or single post, and user can publish topics or anonymous
     1261        // posting is allowed.
     1262        if ( current_user_can( 'publish_topics' ) || ( !is_user_logged_in() && bbp_allow_anonymous() ) )
     1263            $retval = true;
     1264
    12471265    }
    12481266
Note: See TracChangeset for help on using the changeset viewer.