bbp_get_user_favorites( array $args = array() )

Get a user’s favorite topics


Description Description


Parameters Parameters

$args

(Optional) Arguments to pass into bbp_has_topics()

Default value: array()


Top ↑

Return Return

(array) Array of topics if user has favorites, otherwise empty array


Top ↑

Source Source

File: includes/users/engagements.php

function bbp_get_user_favorites( $args = array() ) {
	$r     = bbp_get_user_object_query( $args, 'favorites', '_bbp_favorite' );
	$query = ! empty( $r )
		? bbp_has_topics( $r )
		: array();

	// Filter & return
	return apply_filters( 'bbp_get_user_favorites', $query, 0, $r, $args );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 bbPress (r6618) Signature changed to accept an array of arguments
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.