bbp_get_forums_for_current_user( array $args = array() )
Get the forums the current user has the ability to see and post to
Description Description
Parameters Parameters
- $args
-
(Optional)
Default value: array()
Return Return
(array)
Source Source
File: includes/users/template.php
function bbp_get_forums_for_current_user( $args = array() ) {
// Parse arguments against default values
$r = bbp_parse_args( $args, array(
'post_type' => bbp_get_forum_post_type(),
'post_status' => bbp_get_public_status_id(),
'post__not_in' => bbp_exclude_forum_ids( 'array' ),
'numberposts' => -1
), 'get_forums_for_current_user' );
// Get the forums
$forums = get_posts( $r );
// No availabe forums
if ( empty( $forums ) ) {
$forums = false;
}
// Filter & return
return apply_filters( 'bbp_get_forums_for_current_user', $forums, $r, $args );
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.0.0 | Introduced. |