\

Classes

MS_Controller_Api Exposes the public API.
MS_Model_Member Member model.
MS_Model_Membership Membership model.
MS_Model_Relationship Subscription model (former "Membership Relationship").

Functions

ms_api()

ms_api() : \MS_Controller_Api

Procedural way to load the API instance.

Call this function inside the init hook or later. Using it earlier might cause problems because other parts of M2 might not be completely initialized.

Returns

\MS_Controller_Api

ms_has_membership()

ms_has_membership(integer  $id) : boolean

Template tag: Check if the current user has a specific membership.

Multiple memberships can be specified by adding more parameters to the function call.

Examples:

<?php if ( ms_has_membership() ) : ?> Current user has any membership?

<?php if ( ms_has_membership(100) ) : ?> Current user has membership 100?

<?php if ( ms_has_membership(100,110) ) : ?> Current user has membership 100 or 110?

Parameters

integer $id

Optional. Membership-ID to check. If no value is specified the function will check if the member has any membership at all. Guest/Default memberships are ignored.

Returns

boolean —

True if the current member has any/the specified membership.