Recent

Dashboard_Widgets class

Dashboard_Widgets

Admin Columns Class.

Namespace: WebberZone\Top_Ten\Admin
Since: 3.3.0
Source: includes/admin/class-dashboard-widgets.php line 21

Methods

__construct()

Constructor class.

Since: 3.3.0
Line: 28

public function __construct(  );

dashboard_glance_items()

Add Top 10 views from the current hour to the At a Glance widget.

Since: 4.3.0
Line: 43

public function dashboard_glance_items( $items ): string[];
TypeNameDescription
string[]$itemsArray of extra At a Glance items.

Returns: string[] — Modified array of extra At a Glance items.

dashboard_glance_styles()

Add a better icon for Top 10 At a Glance items.

Since: 4.3.0
Line: 84

public function dashboard_glance_styles(  );

get_current_hour_views() static

Get the number of views recorded in the current hour.

Top 10 stores daily counts in hourly buckets, so this returns the current hour bucket rather than a rolling 60-minute window.

Since: 4.3.0
Line: 105

static public function get_current_hour_views(  ): int;

Returns: int — Number of views in the current hour.

get_views_for_period() static

Get the number of views recorded in a period.

Since: 4.3.0
Line: 118

static public function get_views_for_period( $from_hour, $to_hour ): int;
TypeNameDescription
string$from_hourStart hour in Y-m-d H format.
string$to_hourEnd hour in Y-m-d H format.

Returns: int — Number of views in the period.

get_glance_item() static

Build a Top 10 At a Glance item.

Since: 4.3.0
Line: 144

static public function get_glance_item( $views, $label, $url ): string;
TypeNameDescription
int$viewsViews.
string$labelLabel with a %s placeholder for the formatted count.
string$urlLink URL.

Returns: string — At a Glance item markup.

wp_dashboard_setup() static

Function to add the widgets to the Dashboard.

Since: 3.3.0
Line: 157

static public function wp_dashboard_setup(  );

wp_network_dashboard_setup() static

Function to add the widgets to the Network Dashboard.

Since: 4.2.0
Line: 201

static public function wp_network_dashboard_setup(  );

pop_display() static

Create the Dashboard Widget and content of the Popular pages

Since: 3.3.0
Line: 252

static public function pop_display( $daily = ..., $page = ..., $limit = ..., $widget = ..., $network = ... ): string;
TypeNameDescription
bool$dailySwitch for Custom Period or Overall popular posts.
int$pageWhich page of the lists are on.
int$limitMaximum number of posts per page.
bool$widgetIs this a WordPress widget.
bool$networkWhether to show network-wide posts.

Returns: string — Formatted list of popular posts

Widget for Popular Posts.

Since: 3.3.0
Line: 362

static public function popular_posts_widget(  );

Widget for Custom Period Popular Posts.

Since: 3.3.0
Line: 372

static public function popular_posts_widget_daily(  );

Widget for Network Popular Posts.

Since: 4.2.0
Line: 381

static public function network_popular_posts_widget(  );

Widget for Network Custom Period Popular Posts.

Since: 4.2.0
Line: 390

static public function network_popular_posts_widget_daily(  );

views_over_time_widget() static

Widget for Views Overview (mini chart).

Since: 4.2.0
Line: 399

static public function views_over_time_widget(  );