Skip to:
Content

bbPress.org

Ticket #3309: 3309.diff

File 3309.diff, 1.3 KB (added by dd32, 20 months ago)
  • includes/users/template.php

    function bbp_current_user_can_access_cre 
    22812281 */
    22822282function bbp_current_user_can_access_create_reply_form() {
    22832283
    22842284        // Users need to earn access
    22852285        $retval = false;
    22862286
    22872287        // Always allow keymasters
    22882288        if ( bbp_is_user_keymaster() ) {
    22892289                $retval = true;
    22902290
    22912291        // Looking at a single topic, topic is open, and forum is open
    22922292        } elseif ( ( bbp_is_single_topic() || is_page() || is_single() ) && bbp_is_topic_open() && bbp_is_forum_open() && bbp_is_topic_published() ) {
    22932293                $retval = bbp_current_user_can_publish_replies();
    22942294
    22952295        // User can edit this reply
    2296         } else {
     2296        } elseif ( bbp_get_reply_id() ) {
    22972297                $retval = current_user_can( 'edit_reply', bbp_get_reply_id() );
     2298
     2299        // User can edit this topic
     2300        } elseif ( bbp_get_topic_id() ) {
     2301                $retval = current_user_can( 'edit_topic', bbp_get_topic_id() );
    22982302        }
    22992303
    23002304        // Filter & return
    23012305        return (bool) apply_filters( 'bbp_current_user_can_access_create_reply_form', (bool) $retval );
    23022306}
    23032307
    23042308/**
    23052309 * Performs a series of checks to ensure the current user should see the
    23062310 * anonymous user form fields.
    23072311 *
    23082312 * @since 2.5.0 bbPress (r5119)
    23092313 *
    23102314 * @return bool
    23112315 */
    23122316function bbp_current_user_can_access_anonymous_user_form() {