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

	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.