Display
Display class.
Namespace: WebberZone\Popular_Authors\Frontend
Since: 1.2.0
Source: includes/frontend/class-display.php line 21
Methods
__construct()
Constructor class.
Since: 1.2.0
Line: 28
public function __construct( );
list_popular_authors() static
List all the authors of the site, with several options available.
Since: 1.2.0
Line: 41
static public function list_popular_authors( $args = ... ): void|string;
| Type | Name | Description |
|---|---|---|
array | $args | List of arguments. See self::list_popular_authors_args() for full list. |
Returns: void|string — Void if ‘echo’ argument is true, list of authors if ‘echo’ is false.
get_popular_author_ids() static
Get the popular author IDs.
Since: 1.0.0
Line: 269
static public function get_popular_author_ids( $args = ... ): object;
| Type | Name | Description |
|---|---|---|
string|array | $args | { |
Returns: object — List of popular authors and corresponding view counts.
list_popular_authors_args() static
Fills in missing query variables with default values.
Since: 1.0.0
Line: 508
static public function list_popular_authors_args( $args = ... ): array;
| Type | Name | Description |
|---|---|---|
string|array | $args | { |
Returns: array — Complete query variables with undefined ones filled in with defaults.
get_avatar() static
Retrieve the avatar <img> tag for a user, email address, MD5 hash, comment, or post.
Since: 1.1.0
Line: 581
static public function get_avatar( $author, $args = ... ): string|false;
| Type | Name | Description |
|---|---|---|
\WP_User|int | $author | Author’s \WP_User object or user ID. |
array | $args | { |
Returns: string|false — <img> tag for the user’s avatar. False on failure.
cache_get_key() static
Generate cache key for the given arguments.
Since: 1.2.0
Line: 633
static public function cache_get_key( $args ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Arguments array. |
Returns: string — Cache key.