bbp_get_user_favorites_topic_ids( int $user_id )

Get a user’s favorite topics’ ids

Description

Parameters

$user_id

(Optional) User id

Return

(array|bool) Results if user has favorites, otherwise false

Source

File: bp-forums/users/functions.php

function bbp_get_user_favorites_topic_ids( $user_id = 0 ) {
	$user_id = bbp_get_user_id( $user_id );
	if ( empty( $user_id ) )
		return false;

	$favorites = get_user_option( '_bbp_favorites', $user_id );
	$favorites = array_filter( wp_parse_id_list( $favorites ) );

	return (array) apply_filters( 'bbp_get_user_favorites_topic_ids', $favorites, $user_id );
}

Changelog

Changelog
Version Description
bbPress (r2652) 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.