BP_Bbp_Gdpr_Topics::get_topics( $user,  $page,  $per_page )

Get forum topics created by member.

Description

Parameters

$user

(Required)

$page

(Required)

$per_page

(Required)

Return

(array|bool)

Source

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

165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
function get_topics( $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( 'topics' => $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.