WPDK
1.5.0
WordPress Development Kit
|
Public Member Functions | |
logout () | |
Logout an user. More... | |
wp_authenticate_user ($user) | |
WP authenticate hook. More... | |
wp_login ($user_login, $user=null) | |
WP Login hook. More... | |
wp_login_failed ($user_login) | |
WP Login failed hook. More... | |
signIn ($user, $password, $remember=false) | |
Signin. More... | |
authenticate ($email, $password) | |
User Authenticate. More... | |
wp_logout () | |
WP Logout hook. More... | |
signout () | |
Do signout. More... | |
create ($first_name, $last_name, $email, $password=false, $enabled=false, $role= 'subscriber') | |
show_user_profile ($user) | |
WP Show user profile hook. More... | |
personal_options_update ($id_user) | |
Personal options update hook. More... | |
personal_options ($user) | |
Personal options. More... | |
profile_personal_options ($user) | |
Profile personal options. More... | |
edit_user_profile ($user) | |
WP User Profile hook. More... | |
edit_user_profile_update ($id_user) | |
WP Edit user profile update hook. More... | |
delete_user ($id_user) | |
WP Delete user hook. More... | |
deleted_user ($id_user) | |
WP Deleted user hook. More... | |
user_contactmethods ($contacts) | |
WP User contact methods hook. More... | |
gravatar ($id_user=null, $size=40, $alt= '', $default= 'wavatar') | |
Get html img tag from gravatar.com service. More... | |
avatar ($id_user=null, $size=40) | |
WPDKHTMLTagImg. More... | |
arrayUserForSDF () | |
Static Public Member Functions | |
static | init () |
Init the Singleton instance. More... | |
static | userWithMetaAndValue ($meta_key, $meta_value) |
Get user with meta key and value. More... | |
static | usersWithCaps ($find_caps) |
static | arrayRoles () |
Return all WordPress roles. More... | |
The WPDKUsers allow to manage the WordPress users
This is a singleton class for manage all WordPress users and adding a several extension for control, checking, login and more.
See the WPDKUserMeta
Definition at line 809 of file wpdk-user.php.
|
static |
Return all WordPress roles.
Return a key value pairs array with ID => Description of role
Definition at line 1636 of file wpdk-user.php.
arrayUserForSDF | ( | ) |
Restituisce un array in formato SDF con la lista degli utenti, formattata con 'display name (email)'
Definition at line 1609 of file wpdk-user.php.
authenticate | ( | $email, | |
$password | |||
) |
User Authenticate.
Try to authenticate an user without log-in in the system. This method is very different by signIn(). Return the user ID on success, FALSE otherwise.
string | The email address of the user | |
string | $password | The user password |
Definition at line 1093 of file wpdk-user.php.
avatar | ( | $id_user = null , |
|
$size = 40 |
|||
) |
Return an instance of WPDKHTMLTagImg class
int | $id_user | Optional. User ID or null for current user |
int | $size | Optional. Avatar size. Default 40 |
Definition at line 1573 of file wpdk-user.php.
create | ( | $first_name, | |
$last_name, | |||
$email, | |||
$password = false , |
|||
$enabled = false , |
|||
$role = 'subscriber' |
|||
) |
Create a WordPress user and return the user id on success, WP_Error otherwise.
string | $first_name | First name |
string | $last_name | Last name |
string | Email address | |
bool | string | $password | Optional. Clear password, if set to FALSE a random password is created |
bool | $enabled | Optional. If FALSE the WPDK user status is set to disable. Default FALSE. |
string | $role | Optional. User role, default 'subscriber' |
Definition at line 1164 of file wpdk-user.php.
delete_user | ( | $id_user | ) |
WP Delete user hook.
The delete_user action/hook can be used to perform additional actions when a user is deleted. For example, you can delete rows from custom tables created by a plugin.
The hook passes one parameter: the user's ID. This hook runs before a user is deleted.
The hook deleted_user (notice the "ed") runs after a user is deleted.
Choose the appropriate hook for your needs. If you need access to user meta or fields from the user table, use delete_user. User's deleted from Network Site installs may not trigger this hook. Be sure to use the wpmu_delete_user hook for those cases.
int | $id_user | User ID |
Definition at line 1433 of file wpdk-user.php.
deleted_user | ( | $id_user | ) |
WP Deleted user hook.
The deleted_user action/hook can be used to perform additional actions after a user is deleted. For example, you can delete rows from custom tables created by a plugin.
The hook passes one parameter: the user's ID.
This hook runs after a user is deleted. The hook delete_user (delete vs deleted) runs before a user is deleted.
Choose the appropriate hook for your needs. If you need access to user meta or fields from the user table, use delete_user.
User's deleted from Network Site installs may not trigger this hook. Be sure to use the wpmu_delete_user hook for those cases.
int | $id_user | User ID |
Definition at line 1457 of file wpdk-user.php.
edit_user_profile | ( | $user | ) |
WP User Profile hook.
This hook only triggers when a user is viewing another users profile page (not their own). If you want to apply your hook to ALL profile pages (including the current user) then you also need to use the show_user_profile hook.
WP_User | $user | WordPress user object |
Definition at line 1385 of file wpdk-user.php.
edit_user_profile_update | ( | $id_user | ) |
WP Edit user profile update hook.
This hook only triggers when a user is viewing another user's profile page (not their own). If you want to apply your hook to ALL profile pages (including the current user) then you also need to use the personal_options_update hook.
int | $id_user | User ID |
Definition at line 1402 of file wpdk-user.php.
gravatar | ( | $id_user = null , |
|
$size = 40 , |
|||
$alt = '' , |
|||
$default = 'wavatar' |
|||
) |
Get html img tag from gravatar.com service.
Return the HTML markup of tag img with the user gravatar. FALSE otherwise.
int | $id_user | Optional. User ID or null for current user |
int | $size | Optional. Gravatar size. Default 40 |
string | $alt | Optional. Alternate string for alt attribute. Default user display name. |
string | $default | Optional. Gravatar ID for default (not found) gravatar image, Default wavatar |
Definition at line 1542 of file wpdk-user.php.
|
static |
Init the Singleton instance.
Return a singleton instance of WPDKUsers class
Definition at line 818 of file wpdk-user.php.
logout | ( | ) |
Logout an user.
Force an user logout when disabled or if in GET you pass wpdk_logout
Definition at line 882 of file wpdk-user.php.
personal_options | ( | $user | ) |
Personal options.
Hooks immediately after the "Show toolbar..." option on profile page (if current user). Any HTML output should take into account that this hook occurs within the "Personal Options" table element.
WP_User | $user | WordPress user object |
Definition at line 1349 of file wpdk-user.php.
personal_options_update | ( | $id_user | ) |
Personal options update hook.
This hook only triggers when a user is viewing their own profile page (not others). If you want to apply your hook to ALL profile pages (including users other than the current one) then you also need to use the edit_user_profile_update hook.
int | $id_user | User id |
Definition at line 1335 of file wpdk-user.php.
profile_personal_options | ( | $user | ) |
Profile personal options.
Hooks above the "Name" section of profile page. This is typically used for adding new fields to WordPress profile pages. This hook only triggers if a user is viewing their own profile page. There is no equivalent hook at this point for injecting content onto the profile pages of non-current users.
WP_User | $user | WordPress user object |
Definition at line 1367 of file wpdk-user.php.
show_user_profile | ( | $user | ) |
WP Show user profile hook.
This hook only triggers when a user is viewing their own profile page. If you want to apply your hook to ALL profile pages (not just the current user) then you also need to use the edit_user_profile hook.
WP_User | $user | WordPress user object |
Definition at line 1225 of file wpdk-user.php.
signIn | ( | $user, | |
$password, | |||
$remember = false |
|||
) |
Signin.
Do a WordPress Sign in and call filters and action
string | int | $user | Any user id, user email or user login |
string | $password | Password |
bool | $remember | Optional. TRUE for set a cookie for next login |
Definition at line 1033 of file wpdk-user.php.
signout | ( | ) |
user_contactmethods | ( | $contacts | ) |
WP User contact methods hook.
Not used yet because can't get a clean list of $contancts. Then is not possible to display a series of checkboxes that indicate the fields not to show. For it, in fact, should I use just this filter or private function / internal _wp_get_user_contactmethods ().
array | $contacts |
Definition at line 1474 of file wpdk-user.php.
|
static |
Return the users list with a capability
string | $find_caps | Single capability |
Definition at line 1512 of file wpdk-user.php.
|
static |
Get user with meta key and value.
Return the User id with meta key and meta value.
string | $meta_key | Meta Key |
string | $meta_value | Meta value |
Definition at line 1490 of file wpdk-user.php.
wp_authenticate_user | ( | $user | ) |
WP authenticate hook.
Called when an user is authenticate.
WP_User | $user | WP_User object |
Definition at line 928 of file wpdk-user.php.
wp_login | ( | $user_login, | |
$user = null |
|||
) |
WP Login hook.
This method is called when an user signin with homonymous WordPress action wp_login
.
string | $user_login | User login |
WP_User | $user | Optional. |
Definition at line 961 of file wpdk-user.php.
wp_login_failed | ( | $user_login | ) |
WP Login failed hook.
This method is called when an user wrong signin with homonymous WordPress action wp_login_failed
.
string | $user_login | User login |
Definition at line 988 of file wpdk-user.php.
wp_logout | ( | ) |
WP Logout hook.
This method is called when an user signout with homonymous WordPress action wp_logout
.
Definition at line 1119 of file wpdk-user.php.