PHP Class Timber\User

Inheritance: extends Core, implements Timber\CoreInterface
Show file Open project: jarednova/timber Class Usage Examples

Public Properties

Property Type Description
$_link
$avatar The URL of the author's avatar
$description The description from WordPress
$display_name
$first_name The first name of the user
$id The ID from WordPress
$last_name The last name of the user
$object_type
$representation
$user_nicename

Public Methods

Method Description
__construct ( object | integer | boolean $uid = false )
__set ( string $field, mixed $value )
__toString ( ) : string
get_custom ( ) : array | null
get_meta ( string $field_name ) : null
get_meta_field ( string $field_name ) : mixed
link ( ) : string
meta ( string $field_name ) : mixed
name ( ) : string
path ( ) : string
slug ( ) : string

Protected Methods

Method Description
init ( object | integer | boolean $uid = false )

Method Details

__construct() public method

public __construct ( object | integer | boolean $uid = false )
$uid object | integer | boolean

__set() public method

public __set ( string $field, mixed $value )
$field string
$value mixed

__toString() public method

public __toString ( ) : string
return string a fallback for TimberUser::name()

get_custom() public method

public get_custom ( ) : array | null
return array | null

get_meta() public method

public get_meta ( string $field_name ) : null
$field_name string
return null

get_meta_field() public method

public get_meta_field ( string $field_name ) : mixed
$field_name string
return mixed

init() protected method

protected init ( object | integer | boolean $uid = false )
$uid object | integer | boolean The user ID to use

meta() public method

public meta ( string $field_name ) : mixed
$field_name string
return mixed

name() public method

public name ( ) : string
return string the human-friendly name of the user (ex: "Buster Bluth")

path() public method

public path ( ) : string
return string ex: /author/lincoln

slug() public method

public slug ( ) : string
return string ex baberaham-lincoln

Property Details

$avatar public property

The URL of the author's avatar
public $avatar

$description public property

The description from WordPress
public $description

$display_name public property

public $display_name

$first_name public property

The first name of the user
public $first_name

$id public property

The ID from WordPress
public $id

$last_name public property

The last name of the user
public $last_name

$object_type public property

public $object_type

$representation public static property

public static $representation

$user_nicename public property

public $user_nicename