Disciple_Tools_Users

Class Disciple_Tools_Users Functions for creating, finding, updating or deleting users, wrapping access to the database

package

Disciple_Tools\Users

category

Plugin

author

Chasm.Solutions & Kingdom.Training

since 0.1.0

Methods

Disciple_Tools_Users constructor.

__construct() 

add_current_locations_list

add_current_locations_list( $custom_data) 

Arguments

$custom_data

add_date_availability

add_date_availability( $custom_data) 

Arguments

$custom_data

add_user_location

add_user_location( $grid_id,  $user_id = null) 
static

Arguments

$grid_id

$user_id

Create a Contact for each user that registers

create_contact_for_user( $user_id) : boolean|integer|\WP_Error
static

Arguments

$user_id

Response

boolean|integer|\WP_Error

create_contacts_for_existing_users

create_contacts_for_existing_users() 
static

create_user

create_user( $user_name,  $user_email,  $display_name,  $corresponds_to_contact = null) 
static

Arguments

$user_name

$user_email

$display_name

$corresponds_to_contact

delete_user_filter

delete_user_filter( $id,  $post_type) 
static

Arguments

$id

$post_type

delete_user_location

delete_user_location( $grid_id,  $user_id = null) 
static

Arguments

$grid_id

$user_id

dt_contact_merged

dt_contact_merged( $master_id,  $non_master_id) 

Arguments

$master_id

$non_master_id

Modifies the wp-admin users list table to add a link to the users's contact

dt_edit_user_row_actions( $actions,  $user) : mixed

Arguments

$actions

$user

Response

mixed

Get assignable users

get_assignable_users_compact( $search_string = null,  $get_all = false) : array|\WP_Error
static

Arguments

$search_string

$get_all

Response

array|\WP_Error

Get the base user for the system You can call this function using dt_get_base_user( $id_only = false )

get_base_user(boolean $id_only = false) : array|false|\WP_Error|\WP_User
static
since 0.1.0

Arguments

$id_only

boolean

(optional) Default is false and function returns entire WP_User object.

Response

array|false|\WP_Error|\WP_User

get_contact_for_user

get_contact_for_user( $user_id) 
static

Arguments

$user_id

get_user_filters

get_user_filters( $post_type,  $force_refresh = false) 
static

Arguments

$post_type

$force_refresh

invite_existing_user_to_site

invite_existing_user_to_site( $user_id,  $user_email,  $role) 
static

Arguments

$user_id

$user_email

$role

Modifies the wp-admin users list table to add the display name column

new_modify_user_table( $column) : array

Arguments

$column

Response

array

new_modify_user_table_row

new_modify_user_table_row( $val,  $column_name,  $user_id) 

Arguments

$val

$column_name

$user_id

Profile update hook

profile_update_hook( $user_id) 
static

Arguments

$user_id

save_user_filter

save_user_filter( $filter,  $post_type) 
static

Arguments

$filter

$post_type

Switch user preference for notifications and availability meta fields.

switch_preference(integer $user_id, string $preference_key, string|null $type = null) : array
static

Arguments

$user_id

integer

$preference_key

string

$type

string|null

Response

array

Processes updates posted for current user details.

update_user_contact_info() 
static

user_deleted

user_deleted( $user_id,  $blog_id = null) 

Arguments

$user_id

$blog_id

User register hook Check to see if the user is linked to a contact.

user_register_hook( $user_id) 
static

When adding an existing multisite to the D.T instance. Link the user with the existing contact or create a contact for the user.

Arguments

$user_id