Source Code Documentation


Field Summary | Method Summary | Field Detail | Method Detail

Package s2Member\Utilities

s2member\includes\classes\utils-users.inc.php at line #28

Class c_ws_plugin__s2member_utils_users

c_ws_plugin__s2member_utils_users

public class c_ws_plugin__s2member_utils_users

User utilities.

Since:

3.5


( 11 Methods )
Method Summary
public static str|bool

get_user_custom_with(str $subscr_or_txn_id, str $os0)

Obtains Custom String for an existing Member, referenced by a Subscr.

public static int|bool

get_user_email_with(str $subscr_or_txn_id, str $os0)

Obtains the Email Address for an existing Member, referenced by a Subscr.

public static mixed

get_user_field(str $field_id, int|str $user_id)

Retrieves a field value.

public static int|bool

get_user_id_with(str $subscr_or_txn_id, str $os0)

Obtains the User ID for an existing Member, referenced by a Subscr.

public static mixed|bool

get_user_ipn_signup_var(str $var, int|str $user_id, str $subscr_id)

Retrieves IPN Signup Var & validates their Subscription ID.

public static array|bool

get_user_ipn_signup_vars(int|str $user_id, str $subscr_id)

Retrieves IPN Signup Vars & validates their Subscription ID.

public static int|str|bool

get_user_subscr_or_wp_id(obj $user)

Obtains a User's Paid Subscr.

public static int|bool

ms_user_login_email_can_join_blog(str $user_login, str $user_email, int|str $blog_id)

Determines whether or not a Username/Email is already in the database for this Blog.

public static int|bool

ms_user_login_email_exists_but_not_on_blog(str $user_login, str $user_email, int|str $blog_id)

Determines whether or not a Username/Email is already in the database for this Blog.

public static int|bool

user_login_email_exists(str $user_login, str $user_email)

Determines whether or not a Username/Email is already in the database.

public static int

users_in_database()

Determines the total Users/Members in the database.

( 11 Methods )
Method Detail

s2member\includes\classes\utils-users.inc.php at line #64

get_user_custom_with()

public static str|bool get_user_custom_with(str $subscr_or_txn_id, str $os0)

Obtains Custom String for an existing Member, referenced by a Subscr. or Transaction ID.

A second lookup parameter can be provided as well (optional).

Since:

3.5

Parameters:

str $subscr_or_txn_id - Either a Paid Subscr. ID, or a Paid Transaction ID.

str $os0 - Optional. A second lookup parameter, usually the os0 value for PayPal® integrations.

Returns:

str|bool - The Custom String value on success, else false on failure.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #124

get_user_email_with()

public static int|bool get_user_email_with(str $subscr_or_txn_id, str $os0)

Obtains the Email Address for an existing Member, referenced by a Subscr. or Transaction ID.

A second lookup parameter can be provided as well (optional).

Since:

3.5

Parameters:

str $subscr_or_txn_id - Either a Paid Subscr. ID, or a Paid Transaction ID.

str $os0 - Optional. A second lookup parameter, usually the os0 value for PayPal® integrations.

Returns:

int|bool - A User's Email Address on success, else false on failure.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #293

get_user_field()

public static mixed get_user_field(str $field_id, int|str $user_id)

Retrieves a field value. Also supports Custom Fields.

Since:

3.5

Parameters:

str $field_id - Required. A unique Custom Registration/Profile Field ID, that you configured with s2Member. Or, this could be set to any property that exists on the WP_User object for a particular User; ( i.e. id, ID, user_login, user_email, first_name, last_name, display_name, ip, IP, s2member_registration_ip, s2member_custom, s2member_subscr_id, s2member_subscr_or_wp_id, s2member_subscr_gateway, s2member_custom_fields, s2member_file_download_access_[log|arc], s2member_auto_eot_time, s2member_last_payment_time, s2member_paid_registration_times, s2member_access_role, s2member_access_level, s2member_access_label, s2member_access_ccaps, etc, etc. ).

int|str $user_id - Optional. Defaults to the current User's ID.

Returns:

mixed - The value of the requested field, or false if the field does not exist.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #95

get_user_id_with()

public static int|bool get_user_id_with(str $subscr_or_txn_id, str $os0)

Obtains the User ID for an existing Member, referenced by a Subscr. or Transaction ID.

A second lookup parameter can be provided as well (optional).

Since:

3.5

Parameters:

str $subscr_or_txn_id - Either a Paid Subscr. ID, or a Paid Transaction ID.

str $os0 - Optional. A second lookup parameter, usually the os0 value for PayPal® integrations.

Returns:

int|bool - A WordPress® User ID on success, else false on failure.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #183

get_user_ipn_signup_var()

public static mixed|bool get_user_ipn_signup_var(str $var, int|str $user_id, str $subscr_id)

Retrieves IPN Signup Var & validates their Subscription ID.

The $user_id can be passed in directly; or a lookup can be performed with $subscr_id.

Since:

110912

Parameters:

str $var - Required. The requested Signup Var.

int|str $user_id - Optional. A numeric WordPress® User ID.

str $subscr_id - Optional. Can be used instead of passing in a $user_id. If $subscr_id is passed in, it has to match the one found inside the resulting IPN Signup Vars collected by this routine. If neither of these parameters are passed in, the current User is assumed instead, obtained through wp_get_current_user().

Returns:

mixed|bool - A User's IPN Signup Var on success, else false on failure.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #157

get_user_ipn_signup_vars()

public static array|bool get_user_ipn_signup_vars(int|str $user_id, str $subscr_id)

Retrieves IPN Signup Vars & validates their Subscription ID.

The $user_id can be passed in directly; or a lookup can be performed with $subscr_id.

Since:

3.5

Parameters:

int|str $user_id - Optional. A numeric WordPress® User ID.

str $subscr_id - Optional. Can be used instead of passing in a $user_id. If $subscr_id is passed in, it has to match the one found inside the resulting IPN Signup Vars collected by this routine. If neither of these parameters are passed in, the current User is assumed instead, obtained through wp_get_current_user().

Returns:

array|bool - A User's IPN Signup Vars on success, else false on failure.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #205

get_user_subscr_or_wp_id()

public static int|str|bool get_user_subscr_or_wp_id(obj $user)

Obtains a User's Paid Subscr. ID (if available); otherwise their WP User ID.

If $user IS passed in, this function will return data from a specific $user, or fail if not possible. If $user is NOT passed in, check the current User/Member.

Since:

3.5

Parameters:

obj $user - Optional. A WP_User object. In order to check the current User, you must call this function with no arguments/parameters.

Returns:

int|str|bool - If possible, the User's Paid Subscr. ID, else their WordPress® User ID, else false.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #272

ms_user_login_email_can_join_blog()

public static int|bool ms_user_login_email_can_join_blog(str $user_login, str $user_email, int|str $blog_id)

Determines whether or not a Username/Email is already in the database for this Blog.

This is an alias for: c_ws_plugin__s2member_utils_users::ms_user_login_email_exists_but_not_on_blog().

Returns the WordPress® User ID if they exist.

Since:

3.5

Parameters:

str $user_login - A User's Username.

str $user_email - A User's Email Address.

int|str $blog_id - A numeric WordPress® Blog ID.

Returns:

int|bool - If exists (but not on Blog), a WordPress® User ID, else false.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #249

ms_user_login_email_exists_but_not_on_blog()

public static int|bool ms_user_login_email_exists_but_not_on_blog(str $user_login, str $user_email, int|str $blog_id)

Determines whether or not a Username/Email is already in the database for this Blog.

Returns the WordPress® User ID if they exist.

Since:

3.5

Parameters:

str $user_login - A User's Username.

str $user_email - A User's Email Address.

int|str $blog_id - A numeric WordPress® Blog ID.

Returns:

int|bool - If exists (but not on Blog), a WordPress® User ID, else false.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #226

user_login_email_exists()

public static int|bool user_login_email_exists(str $user_login, str $user_email)

Determines whether or not a Username/Email is already in the database.

Returns the WordPress® User ID if they exist.

Since:

3.5

Parameters:

str $user_login - A User's Username.

str $user_email - A User's Email Address.

Returns:

int|bool - If exists, a WordPress® User ID, else false.

[ back to top ]

s2member\includes\classes\utils-users.inc.php at line #38

users_in_database()

public static int users_in_database()

Determines the total Users/Members in the database.

Since:

3.5

Returns:

int - Number of Users in the database, total.

[ back to top ]

Source Code Documentation


Field Summary | Method Summary | Field Detail | Method Detail