Methods

__construct()

__construct() 

User constructor.

check_membership()

check_membership() 

add_um_role_existing_user()

add_um_role_existing_user(  $user_id,   $result) 

Multisite add existing user

Parameters

$user_id
$result

add_um_role_wpmu_new_user()

add_um_role_wpmu_new_user(  $user_id) 

Multisite add existing user

Parameters

$user_id

get_pending_users_count()

get_pending_users_count() 

Get pending users (in queue)

get_profile_slug()

get_profile_slug(  $user_id) : boolean|mixed

Parameters

$user_id

Returns

boolean|mixed

get_profile_link()

get_profile_link(  $user_id) : boolean|string

Parameters

$user_id

Returns

boolean|string

generate_profile_slug()

generate_profile_slug(  $user_id,   $force = false) 

Parameters

$user_id
$force

user_register_via_admin()

user_register_via_admin(  $user_id) 

Backend user creation

Parameters

$user_id

profile_update()

profile_update(integer  $user_id, \WP_User  $old_data) 

On wp_update_user function complete

Parameters

integer $user_id
\WP_User $old_data

profile_form_additional_section()

profile_form_additional_section(\WP_User  $userdata) : void

Additional section for WP Profile page with UM data fields

Parameters

\WP_User $userdata

User data

secondary_role_field()

secondary_role_field(string  $content, \WP_User  $userdata) : string

Default interface for setting a ultimatemember role

Parameters

string $content

Section HTML

\WP_User $userdata

User data

Returns

string

remove_cached_queue()

remove_cached_queue() 

Remove cached queue from Users backend

toArray()

toArray(  $obj) : array

Converts object to array

Parameters

$obj

Returns

array

get_cached_data()

get_cached_data(  $user_id) : mixed|string|void

Parameters

$user_id

Returns

mixed|string|void

setup_cache()

setup_cache(  $user_id,   $profile) 

Parameters

$user_id
$profile

remove_cache()

remove_cache(  $user_id) 

Parameters

$user_id

set()

set(null|integer  $user_id = null, boolean  $clean = false) 

This method lets you set a user. For example, to retrieve a profile or anything related to that user.

Parameters

null|integer $user_id

Which user to retrieve. A numeric user ID

boolean $clean

Should be true or false. Basically, if you did not provide a user ID It will set the current logged in user as a profile

Examples

following example makes you set a user and retrieve their display name after that using the user API. <?php UM()->user()->set( 12 ); $display_name = UM()->user()->profile['display_name']; // Should print user display name ?>
** File not found : The **

reset()

reset(boolean  $clean = false) 

Reset user data

Parameters

boolean $clean

clean()

clean() 

Clean user profile

auto_login()

auto_login(integer  $user_id, integer|boolean  $rememberme) 

This method lets you auto sign-in a user to your site.

Parameters

integer $user_id

Which user ID to sign in automatically

integer|boolean $rememberme

Should be true or false. If you want the user sign in session to use cookies, use true

Examples

following example lets you sign in a user automatically by their ID. <?php UM()->user()->auto_login( 2 ); ?>
** File not found : The **
following example lets you sign in a user automatically by their ID and makes the plugin remember their session. <?php UM()->user()->auto_login( 10, true ); ?>
** File not found : The **

set_registration_details()

set_registration_details(  $submitted) 

Set user's registration details

Parameters

$submitted

set_plain_password()

set_plain_password(  $plain) 

A plain version of password

Parameters

$plain

set_last_login()

set_last_login() 

Set last login for new registered users

set_status()

set_status(  $status) 

Set user's account status

Parameters

$status

password_reset_hash()

password_reset_hash() 

Set user's hash for password reset

assign_secretkey()

assign_secretkey() 

Set user's hash

password_reset()

password_reset() 

Password reset email

password_changed()

password_changed() 

Password changed email

approve()

approve() 

This method approves a user membership and sends them an optional welcome/approval e-mail.

Examples

a pending user and allow him to sign-in to your site. <?php um_fetch_user( 352 ); UM()->user()->approve(); ?>
** File not found : Approve **

email_pending()

email_pending() 

Pending email

pending()

pending() 

This method puts a user under manual review by administrator and sends them an optional e-mail.

Examples

example of putting a user pending manual review <?php um_fetch_user( 54 ); UM()->user()->pending(); ?>
** File not found : An **

reject()

reject() 

This method rejects a user membership and sends them an optional e-mail.

Examples

a user membership example <?php um_fetch_user( 114 ); UM()->user()->reject(); ?>
** File not found : Reject **

deactivate()

deactivate() 

This method deactivates a user membership and sends them an optional e-mail.

Examples

a user membership with the following example <?php um_fetch_user( 32 ); $ultimatemember->user->deactivate(); ?>
** File not found : Deactivate **

delete()

delete(boolean  $send_mail = true) 

Delete user

Parameters

boolean $send_mail

get_role()

get_role() : string

This method gets a user role in slug format. e.g. member

Returns

string

Examples

something if the user's role is paid-member <?php um_fetch_user( 12 ); if ( UM()->user()->get_role() == 'paid-member' ) { // Show this to paid customers } else { // You are a free member } ?>
** File not found : Do **

update_usermeta_info()

update_usermeta_info(  $key) 

Update one key in user meta

Parameters

$key

delete_meta()

delete_meta(string  $key) 

This method can be used to delete user's meta key.

Parameters

string $key

The meta field key to remove from user

@example Delete user's age field

<?php

um_fetch_user( 15 ); UM()->user()->delete_meta( 'age' );

?>

get_admin_actions()

get_admin_actions() : array|boolean

Get admin actions for individual user

Returns

array|boolean

is_private_profile()

is_private_profile(integer  $user_id) : boolean

This method checks if give user profile is private.

Parameters

integer $user_id

A user ID must be passed to check if the user profile is private

Returns

boolean

Examples

example display a specific user's name If his profile is public <?php um_fetch_user( 60 ); $is_private = UM()->user()->is_private_profile( 60 ); if ( ! $is_private ) { echo 'User is public and his name is ' . um_user('display_name'); } ?>
** File not found : This **

is_approved()

is_approved(integer  $user_id) : boolean

This method can be used to determine If a certain user is approved or not.

Parameters

integer $user_id

The user ID to check approval status for

Returns

boolean

Examples

something If a user's membership is approved <?php if ( UM()->user()->is_approved( 55 ) { // User account is approved } else { // User account is not approved } ?>
** File not found : Do **

is_private_case()

is_private_case(  $user_id,   $case) : boolean|mixed|void

Is private

Parameters

$user_id
$case

Returns

boolean|mixed|void

update_files()

update_files(  $changes) 

Update files

Parameters

$changes

update_profile()

update_profile(  $changes) 

Update profile

Parameters

$changes

user_has_metadata()

user_has_metadata(  $key,   $value) : boolean|integer

User exists by meta key and value

Parameters

$key
$value

Returns

boolean|integer

user_exists_by_name()

user_exists_by_name(  $value) : boolean

User exists by name

Parameters

$value

Returns

boolean

user_exists_by_id()

user_exists_by_id(integer  $user_id) : boolean|integer

This method checks if a user exists or not in your site based on the user ID.

Parameters

integer $user_id

A user ID must be passed to check if the user exists

Returns

boolean|integer

Examples

Usage <?php $boolean = UM()->user()->user_exists_by_id( 15 ); if ( $boolean ) { // That user exists } ?>
** File not found : Basic **

user_exists_by_email_as_username()

user_exists_by_email_as_username(string  $slug) : boolean

This method checks if a user exists or not in your site based on the user email as username

Parameters

string $slug

A user slug must be passed to check if the user exists

Returns

boolean

Examples

Usage <?php $boolean = UM()->user()->user_exists_by_email_as_username( 'calumgmail-com' ); if ( $boolean ) { // That user exists } ?>
** File not found : Basic **

set_gravatar()

set_gravatar(  $user_id) : string

Set gravatar hash id

Parameters

$user_id

Returns

string