This is based on the membership ID which changes for every user that is granted a membership (on my site I do this manually). Is it possible to use the plan ID? Because the plan is always the same.
Is it possible to do the same thing based on user role ID? This would help me alot.
The code snippet from the linked topic is based on the membersip plan ID
Please try this PHP snippet. Please change 1,2,3 on the categories id that you want to remove from the selection and please change role name on the role name which user has to not see some categories