Class Author
Author entity class.
Provides a nicely object-oriented interface to a Wordpress post author.
-
Tev\Author\Model\Author
implements
Tev\Contracts\WordpressWrapperInterface
Methods summary
public
|
#
__construct( WP_User $base )
Constructor.
Inject dependencies.
Parameters
- $base
- Base
WP_User object
|
public
integer
|
#
getId( )
Get the author ID.
Returns
integer
|
public
string
|
#
getFirstName( )
Get the author first name.
Get the author first name.
Returns
string
|
public
string
|
#
getLastName( )
Get the author last first name.
Get the author last first name.
Returns
string
|
public
string
|
#
getNiceName( )
Get the author nice name.
Get the author nice name.
Returns
string
|
public
string
|
#
getDisplayName( )
Get the author display name.
Get the author display name.
Returns
string
|
public
string
|
#
getEmail( )
Get the author email address.
Get the author email address.
Returns
string
|
public
string
|
#
getUrl( )
Get the author URL (link to their own blog or website).
Get the author URL (link to their own blog or website).
Returns
string
|
public
string
|
#
getPostsUrl( )
Get the URL to the author's posts on this app.
Get the URL to the author's posts on this app.
Returns
string
|
public
integer
|
#
getPostCount( )
Get the total number of published posts the author has.
Get the total number of published posts the author has.
Returns
integer
|
public
string
|
#
getMeta( string $field )
Get a meta field value for this author.
Get a meta field value for this author.
Parameters
Returns
string Field data. Empty string if field does not exist
|
public
string
|
#
getAvatarTag( integer $size = 96, string $alt = null )
Get an image tag for this author's avatar.
Get an image tag for this author's avatar.
Parameters
- $size
- Avatar size. Max 512, default 96
- $alt
- Alt text. Defaults to display name
Returns
string
|
public
WP_User
|
#
getBaseObject( )
Get the underlying WP_User object.
Get the underlying WP_User object.
Returns
WP_User
Implementation of
|