bbp_current_user_can_access_create_reply_form()

Performs a series of checks to ensure the current user can create replies.

Description

Return

(bool)

Source

File: bp-forums/users/template.php

2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
function bbp_current_user_can_access_create_reply_form() {
 
    // Users need to earn access
    $retval = false;
 
    // Always allow keymasters
    if ( bbp_is_user_keymaster() ) {
        $retval = true;
 
    // Looking at a single topic, topic is open, and forum is open
    } elseif ( ( bbp_is_single_topic() || is_page() || is_single() ) && bbp_is_topic_open() && bbp_is_forum_open() ) {
        $retval = bbp_current_user_can_publish_replies();
 
    // User can edit this topic
    } elseif ( bbp_is_reply_edit() ) {
        $retval = current_user_can( 'edit_reply', bbp_get_reply_id() );
    }
 
    // Allow access to be filtered
    return (bool) apply_filters( 'bbp_current_user_can_access_create_reply_form', (bool) $retval );
}

Changelog

Changelog
Version Description
bbPress (r3127) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.