Method |
Description |
|
__construct ( integer | object | array | string $user, string $name = '', integer | string $blog_id = '' ) : WPDKUser |
Create an instance of WPDKUser class |
|
age ( string $birthday ) : integer |
Return the age (in year) from a date in format YYYY-MM-DD or DD/MM/YYYY |
|
allCapabilities ( ) : array |
Restituisce la lista di tutte le capabilities attualmente presenti in WordPress, scorrendo tutti i ruoli
presenti ed estraendo le capabilities. |
|
avatar ( integer $size = 40 ) : WPDKHTMLTagImg | boolean |
This method is an alias of WPDKUsers::avatar(). Return on instance of WPDKHTMLTagImg class, FALSE otherwise. |
|
create ( string $first_name, string $last_name, string $email, boolean | string $password = false, boolean $enabled = false, string $role = 'subscriber' ) : integer | WP_Error |
This method is an alias of WPDKUsers::create() |
|
current_user ( ) : WPDKUser |
Return an instance of WPDKUser class for the current user logged in or null if no user found/logged in |
|
deleteTransient ( string $transient ) : boolean |
Delete a user transient for this WPDKUser object instance. Return TRUE if successful, FALSE otherwise |
|
deleteTransientWithUser ( string $transient, integer $user_id = null ) : boolean |
Delete a user transient. Return TRUE if successful, FALSE otherwise |
|
full_name ( string $firstName, string $lastName, boolean $nameFirst = true ) : string |
Return a full name by first and last name. |
|
getTransient ( string $transient ) : mixed |
Get the value of transient for this WPDKUser object instance. |
|
getTransientTime ( string $transient ) : integer |
Return the transient user time |
|
getTransientTimeWithUser ( string $transient, integer $user_id = null ) : integer |
Return the transient user time |
|
getTransientWithUser ( string $transient, integer $user_id = null ) : mixed |
Get the value of a user transient. |
|
gravatar ( integer $size = 40, string $alt = '', string $default = "wavatar" ) : string |
This method is an alias of WPDKUsers::gravatar(). Return the HTML markup for tag img. False otherwise. |
|
hasCap ( string $cap, integer $id_user = null ) : boolean |
Restutuisce true se l'utente passato negli inputs (o l'utente corrente se non viene passato id utente) possiede
un determinato permesso (capability) |
|
hasCaps ( string | array $caps ) : boolean |
Return TRUE if the user has one or more capabilities. |
|
hasRoles ( string | array $roles ) : boolean |
Return TRUE if the current user has one o more roles. |
|
nice_name ( string $firstName, string $lastName ) : string |
Return a nice name by vompose the first letter of first name and append last name, Eg. John Gold -> J.Gold. |
|
roleNameForUserID ( integer $id_user ) : boolean | string |
Return the role name of a user |
|
setTransient ( string $transient, mixed $value, integer $expiration ) : boolean |
Set/update the value of transient for this WPDKUser object instance. |
|
setTransientWithUser ( string $transient, mixed $value, integer $expiration, integer $user_id = null ) : boolean |
Set/update the value of a user transient. |
|
set_role ( string $role ) |
Set the role of the user. Perform a cache clear for this user. |
|
updateUserCapabilities ( integer $id_user, array $selected_caps, array $capabilities ) |
Aggiunge e/o rimuove i permessi (capability) da un utente. L'aggiunta avviene eseguendo una match tra una lista
di capability selezionate e una lista di confronto, che corrisponde in pratica alle capabilities che possono
essere aggiunte. Senza il parametro $capabilities verrebbero prese in considerazione tutte le capabilities, cosa
che ovviamente non va bene. In pratica questo metodo dice; in base a questa lista ($capabilities) quali tra
quelle selezionate ($selected_caps) devo attivate/disattivare ? |
|