Recent

Popular_Authors_Display class

Class for displaying author’s top posts.

Namespace: WebberZone\Popular_Authors\Frontend
Since: 1.3.0
Source: includes/frontend/class-popular-authors-display.php line 21

Methods

get_author_top_posts() static

Get top posts for a specific author.

Since: 1.3.0
Line: 41

static public function get_author_top_posts( $author, $field = ..., $args = ... ): array|\WP_Error;
TypeNameDescription
int|string$authorAuthor value for $field. A user ID, slug, email address, or login name.
string$fieldField to query by: ‘id’, ‘ID’, ‘slug’, ‘email’, or ‘login’.
array$args{

Returns: array|\WP_Error — Array of post objects or \WP_Error on failure.

display_author_top_posts() static

Display author’s top posts.

Since: 1.3.0
Line: 76

static public function display_author_top_posts( $author, $field = ..., $args = ... ): string;
TypeNameDescription
int|string$authorAuthor value for $field. A user ID, slug, email address, or login name.
string$fieldField to query by: ‘id’, ‘ID’, ‘slug’, ‘email’, or ‘login’.
array$argsOptional. Arguments for the query.

Returns: string — HTML output of the author’s top posts.