c_ws_plugin__s2member_utils_users
public class c_ws_plugin__s2member_utils_users
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 | Determines the total Users/Members in the database. |
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).
3.5
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.
str|bool - The Custom String value on success, else false on failure.
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).
3.5
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.
int|bool - A User's Email Address on success, else false on failure.
public static mixed get_user_field(str $field_id, int|str $user_id)
Retrieves a field value. Also supports Custom Fields.
3.5
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.
mixed - The value of the requested field, or false if the field does not exist.
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).
3.5
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.
int|bool - A WordPress® User ID on success, else false on failure.
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
.
110912
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()
.
mixed|bool - A User's IPN Signup Var on success, else false on failure.
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
.
3.5
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()
.
array|bool - A User's IPN Signup Vars on success, else false on failure.
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.
3.5
obj $user - Optional. A WP_User
object. In order to check the current User, you must call this function with no arguments/parameters.
int|str|bool - If possible, the User's Paid Subscr. ID, else their WordPress® User ID, else false.
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.
3.5
str $user_login - A User's Username.
str $user_email - A User's Email Address.
int|str $blog_id - A numeric WordPress® Blog ID.
int|bool - If exists (but not on Blog), a WordPress® User ID, else false.
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.
3.5
str $user_login - A User's Username.
str $user_email - A User's Email Address.
int|str $blog_id - A numeric WordPress® Blog ID.
int|bool - If exists (but not on Blog), a WordPress® User ID, else false.
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.
3.5
str $user_login - A User's Username.
str $user_email - A User's Email Address.
int|bool - If exists, a WordPress® User ID, else false.
public static int users_in_database()
Determines the total Users/Members in the database.
3.5
int - Number of Users in the database, total.
User utilities.