mardi 13 octobre 2015

array in conditional statement for member level, Paid Memberships Pro, not working

I want to update a custom plugin that uses Paid Memberships Pro so that it shows a form on a page only to members at levels 3 or 4.

Currently the function (shows a form) only to users at level 3.

If I swap out "3" for "4" it works perfectly for member levels at 4.

Here's the relevant part of the code:

$userID = get_current_user_id();
if (pmpro_hasMembershipLevel(3, $userID)) {

I know what I want is an array but I think the $userID after the number 3 is throwing me off. I've tried variations but don't know the correct syntax to make this right. Any help much appreciated.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire