Display
Display class
Namespace: WebberZone\Top_Ten\Frontend
Since: 3.3.0
Source: includes/frontend/class-display.php line 22
Methods
__construct()
Constructor class.
Since: 3.3.0
Line: 29
public function __construct( );
pop_posts() static
Function to return formatted list of popular posts.
Since: 3.3.0
Line: 40
static public function pop_posts( $args ): string;
| Type | Name | Description |
|---|---|---|
mixed | $args | Arguments array. |
Returns: string — HTML output of the popular posts.
get_pop_posts() static
Function to retrieve the popular posts.
Since: 3.3.0
Line: 310
static public function get_pop_posts( $args = ... );
| Type | Name | Description |
|---|---|---|
mixed | $args | Arguments list. |
show_pop_posts()
Function to echo popular posts.
Since: 3.3.0
Line: 509
public function show_pop_posts( $args = ... );
| Type | Name | Description |
|---|---|---|
mixed | $args | Arguments list. |
show_daily_pop_posts()
Function to show daily popular posts.
Since: 3.3.0
Line: 527
public function show_daily_pop_posts( $args = ... );
| Type | Name | Description |
|---|---|---|
mixed | $args | Arguments list. |
get_posts() static
Retrieves an array of the popular posts.
The defaults are as follows:
Since: 3.3.0
Line: 549
static public function get_posts( $args = ... ): \WP_Post[]|int[];
| Type | Name | Description |
|---|---|---|
array | $args | Optional. Arguments to retrieve posts. See WP_Query::parse_query() for all available arguments. |
Returns: \WP_Post[]|int[] — Array of post objects or post IDs.
link_attributes() static
Returns the link attributes.
Since: 3.3.0
Line: 576
static public function link_attributes( $args, $result ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
\WP_Post | $result | Result object. |
Returns: string — Space separated list of link attributes
heading_title() static
Returns the heading of the popular posts.
Since: 3.3.0
Line: 613
static public function heading_title( $args ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
Returns: string — Space separated list of link attributes
before_list() static
Returns the opening tag of the popular posts list.
Since: 3.3.0
Line: 641
static public function before_list( $args ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
Returns: string — Space separated list of link attributes
after_list() static
Returns the closing tag of the popular posts list.
Since: 3.3.0
Line: 665
static public function after_list( $args ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
Returns: string — Space separated list of link attributes
before_list_item() static
Returns the opening tag of each list item.
Since: 3.3.0
Line: 690
static public function before_list_item( $args, $result ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
\WP_Post | $result | Object of the current post result. |
Returns: string — Space separated list of link attributes
after_list_item() static
Returns the closing tag of each list item.
Since: 3.3.0
Line: 716
static public function after_list_item( $args, $result ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
\WP_Post | $result | Object of the current post result. |
Returns: string — Space separated list of link attributes
get_the_title() static
Returns the title of each list item.
Since: 3.3.0
Line: 742
static public function get_the_title( $args, $result ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
\WP_Post | $result | Object of the current post result. |
Returns: string — Space separated list of link attributes
get_the_author() static
Returns the author of each list item.
Since: 3.3.0
Line: 768
static public function get_the_author( $args, $result ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
\WP_Post | $result | Object of the current post result. |
Returns: string — Space separated list of link attributes
list_link() static
Returns the formatted list item with link and and thumbnail for each list item.
Since: 3.3.0
Line: 813
static public function list_link( $args, $result ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
\WP_Post | $result | Object of the current post result. |
Returns: string — Space separated list of link attributes
get_the_date() static
Returns the title of each list item.
Since: 3.3.0
Line: 875
static public function get_the_date( $args, $result ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
\WP_Post | $result | Object of the current post result. |
Returns: string — Formatted post date
get_list_count() static
Returns the title of each list item.
Since: 3.3.0
Line: 902
static public function get_list_count( $args, $result, $visits ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. |
\WP_Post | $result | Object of the current post result. |
int | $visits | Number of visits. |
Returns: string — Formatted post date
get_the_ratings() static
Returns the WP-PostRatings rating of each list item.
Since: 4.4.0
Line: 931
static public function get_the_ratings( $args, $result ): string;
| Type | Name | Description |
|---|---|---|
array | $args | Array of arguments. show_ratings can be stars (WP-PostRatings template) or score (average rating number). |
\WP_Post | $result | Object of the current post result. |
Returns: string — Formatted rating markup. Empty string if WP-PostRatings is not active.
get_the_excerpt() static
Function to create an excerpt for the post.
Since: 4.0.0
Line: 966
static public function get_the_excerpt( $post, $excerpt_length = ..., $use_excerpt = ..., $more_link_text = ... ): string;
| Type | Name | Description |
|---|---|---|
int|\WP_Post | $post | Post ID or WP_Post instance. |
int|string | $excerpt_length | Length of the excerpt in words. |
bool | $use_excerpt | Use excerpt instead of content. |
string|null | $more_link_text | Read More text. Pass null to use the default “(more…)” link. Default ” (no Read More link). |
Returns: string — Post Excerpt
get_default_thumbnail() static
Get the default thumbnail.
Since: 4.0.0
Line: 1071
static public function get_default_thumbnail( ): string;
Returns: string — Default thumbnail.
exclude_on() static
Processes exclusion settings to return if the popular posts should not be displayed on the current post.
Since: 3.3.0
Line: 1084
static public function exclude_on( $post = ..., $args = ... ): bool;
| Type | Name | Description |
|---|---|---|
int|\WP_Post|null | $post | Post ID or post object. Defaults to global $post. Default null. |
array | $args | Parameters in a query string format. |
Returns: bool — True if any exclusion setting is matched.
get_static_excluded_ids() static
Get static excluded post IDs that should affect caching.
These are exclusions that are consistent across requests for the same configuration.
Since: 4.2.0
Line: 1147
static public function get_static_excluded_ids( $args ): array;
| Type | Name | Description |
|---|---|---|
array | $args | Arguments array. |
Returns: array — Array of post IDs to exclude statically.
get_dynamic_excluded_ids() static
Get dynamic excluded post IDs that are per-request and should not affect caching.
Since: 4.2.0
Line: 1213
static public function get_dynamic_excluded_ids( $args ): array;
| Type | Name | Description |
|---|---|---|
array | $args | Arguments array. |
Returns: array — Array of post IDs to exclude dynamically.