bbp_current_user_can_publish_forums()

Check if the current user can publish forums

Description

Return

(bool)

Source

File: bp-forums/users/template.php

1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
function bbp_current_user_can_publish_forums() {
 
    // Users need to earn access
    $retval = false;
 
    // Always allow keymasters
    if ( bbp_is_user_keymaster() ) {
        $retval = true;
 
    // User is logged in
    } elseif ( current_user_can( 'publish_forums' ) ) {
        $retval = true;
    }
 
    // Allow access to be filtered
    return (bool) apply_filters( 'bbp_current_user_can_publish_forums', $retval );
}

Changelog

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