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

	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.