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
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
| 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.