\MainWP\Dashboard\Module\LogLog_Author

Class Log_Author.

Summary

Methods
Properties
Constants
__construct()
__get()
__toString()
get_display_name()
get_agent()
get_role()
is_deleted()
is_wp_cli()
is_doing_wp_cron()
get_current_agent()
get_agent_label()
$id
$meta
No constants found
No protected methods found
$user
N/A
No private methods found
No private properties found
N/A

Properties

$id

$id : integer

Holds User ID.

Type

integer

$meta

$meta : array

Holds User meta data.

Type

array

$user

$user : \WP_User

Holds WP user object connected to "$this" instance.

Type

\WP_User

Methods

__construct()

__construct(integer  $user_id, array  $user_meta = array()) 

Class constructor.

Parameters

integer $user_id

The user ID.

array $user_meta

The user meta array.

__get()

__get(string  $name) : string

Get various user meta data

Parameters

string $name

User meta key.

Throws

\Exception

Meta not found | User not found.

Returns

string

__toString()

__toString() : string

Returns string representation of this object

Returns

string

get_display_name()

get_display_name() : string

Get the display name of the user

Returns

string

get_agent()

get_agent() : string

Get the agent of the user

Returns

string

get_role()

get_role() : string

Tries to find a label for the record's user_role.

If the user_role exists, use the label associated with it.

Otherwise, if there is a user role label stored as Log meta then use that. Otherwise, if the user exists, use the label associated with their current role. Otherwise, use the role slug as the label.

Returns

string

is_deleted()

is_deleted() : boolean

True if user no longer exists, otherwise false

Returns

boolean

is_wp_cli()

is_wp_cli() : boolean

True if user is WP-CLI, otherwise false

Returns

boolean

is_doing_wp_cron()

is_doing_wp_cron() : boolean

Check if the current request is part of a WP cron task.

Note: This will return true for all manual or custom cron runs even if the default front-end cron is disabled.

We're not using wp_doing_cron() since it was introduced only in WordPress 4.8.0.

Returns

boolean

get_current_agent()

get_current_agent() : string

Look at the environment to detect if an agent is being used

Returns

string

get_agent_label()

get_agent_label(string  $agent) : string

Get the agent label

Parameters

string $agent

Key representing agent.

Returns

string