bbp_current_user_can_access_anonymous_user_form()

Performs a series of checks to ensure the current user should see the anonymous user form fields.

Description

Return

(bool)

Source

File: bp-forums/users/template.php

2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
function bbp_current_user_can_access_anonymous_user_form() {
 
    // Users need to earn access
    $retval = false;
 
    // User is not logged in, and anonymous posting is allowed
    if ( bbp_is_anonymous() ) {
        $retval = true;
 
    // User is editing a topic, and topic is authored by anonymous user
    } elseif ( bbp_is_topic_edit() && bbp_is_topic_anonymous() ) {
        $retval = true;
 
    // User is editing a reply, and reply is authored by anonymous user
    } elseif ( bbp_is_reply_edit() && bbp_is_reply_anonymous() ) {
        $retval = true;
    }
 
    // Allow access to be filtered
    return (bool) apply_filters( 'bbp_current_user_can_access_anonymous_user_form', (bool) $retval );
}

Changelog

Changelog
Version Description
bbPress (r5119) 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.