// Looking at a single forum & forum is open
if ( ( bbp_is_single_forum() || is_page() || is_single() ) && bbp_is_forum_open() )
$retval = bbp_current_user_can_publish_topics();
// User can edit this topic
elseif ( bbp_is_topic_edit() )
$retval = current_user_can( 'edit_topic', bbp_get_topic_id() );
// Allow access to be filtered
return apply_filters( 'bbp_current_user_can_access_create_topic_form', (bool) $retval );
}
/**
* Performs a series of checks to ensure the current user can create replies.
*
* @since bbPress (r3127)
*
* @uses bbp_is_topic_edit()
* @uses current_user_can()
* @uses bbp_get_topic_id()