BP_Bbp_Gdpr_Forums::get_forums( $user,  $page,  $per_page )

Fetch all the user forums.

Description

Parameters

$user

(Required)

$page

(Required)

$per_page

(Required)

Return

(array|bool)

Source

File: bp-core/gdpr/class-bp-bbp-gdpr-forums.php

168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
function get_forums( $user, $page, $per_page ) {
    $pp_args = array(
        'post_type'      => $this->post_type,
        'author'         => $user->ID,
        'posts_per_page' => $per_page,
        'paged'          => $page,
    );
 
    $the_query = new \WP_Query( $pp_args );
 
    if ( $the_query->have_posts() ) {
        return array( 'forums' => $the_query->posts, 'total' => $the_query->post_count );
    }
 
    return false;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 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.