bbp_current_user_can_access_create_topic_form()
Performs a series of checks to ensure the current user can create topics.
Description Description
Return Return
(bool)
Source Source
File: includes/users/template.php
function bbp_current_user_can_access_create_topic_form() { // Users need to earn access $retval = false; // Always allow keymasters if ( bbp_is_user_keymaster() ) { $retval = true; // Looking at a single forum & forum is open } elseif ( ( bbp_is_single_forum() || is_page() || is_single() ) && bbp_is_forum_open() ) { $retval = bbp_current_user_can_publish_topics(); // User can edit this topic } else { $retval = current_user_can( 'edit_topic', bbp_get_topic_id() ); } // Filter & return return (bool) apply_filters( 'bbp_current_user_can_access_create_topic_form', (bool) $retval ); }
Changelog Changelog
Version | Description |
---|---|
2.0.0 | Introduced. |