Tagged: member type
Hi,
I’m trying to get current user member type, but i have an error,
here my constructor/** * @var array|bool|string member type de l'utilisateur (speacker, particpant etc..) */ private $member_type; /** * @var int id de l'utilisateur courrant */ private $user_id; public function __construct() { $this->user_id = wp_get_current_user()->ID; $this->member_type = bp_get_member_type($this->user_id); dump($this->member_type);die(); }
My dump return false, and have this errors : array_merge(): Expected parameter 2 to be an array, object given in C:\laragon\www\yoostart\web\app\plugins\buddypress\bp-core\bp-core-taxonomy.php on line 145.
Warning: Invalid argument supplied for foreach() in C:\laragon\www\yoostart\web\app\plugins\buddypress\bp-members\bp-members-functions.php on line 2763.Any idea?
Thanks.
Hi Ahmed,
You are calling the function too early. Please make sure it is called on/after bp_init and it will work.
Regards
Brajesh
Viewing 4 posts - 1 through 4 (of 4 total)
The topic ‘ [Resolved] Error when trying to get member type’ is closed to new replies.
This topic is: resolved