Dashboard
Admin Dashboard Class.
Namespace: WebberZone\Top_Ten\Admin
Since: 3.0.0
Source: includes/admin/class-dashboard.php line 22
Methods
__construct()
Constructor class.
Since: 3.0.0
Line: 38
public function __construct( );
render_page()
Render the settings page.
Since: 3.0.0
Line: 50
public function render_page( );
admin_menu()
Admin Menu.
Since: 3.0.0
Line: 192
public function admin_menu( );
network_admin_menu()
Network Admin Menu.
Since: 4.2.0
Line: 221
public function network_admin_menu( );
admin_enqueue_scripts()
Enqueue scripts in admin area.
Since: 3.0.0
Line: 250
public function admin_enqueue_scripts( $hook );
| Type | Name | Description |
|---|---|---|
string | $hook | The current admin page. |
fetch_visits_by_date() static
Fetch chart data for visits over time.
Since: 4.2.0
Line: 293
static public function fetch_visits_by_date( $from_date, $to_date, $network = ... ): array;
| Type | Name | Description |
|---|---|---|
string | $from_date | Start date in Y-m-d format. |
string | $to_date | End date in Y-m-d format. |
bool | $network | Whether to fetch network-wide data. |
Returns: array — Chart data with date and visits.
get_chart_data()
Function to add an action to search for tags using Ajax.
Since: 3.0.0
Line: 341
public function get_chart_data( );
get_tabs()
Array containing the settings’ sections.
Since: 3.0.0
Line: 372
public function get_tabs( ): array;
Returns: array — Settings array
display_popular_posts()
Get popular posts for a date range.
Since: 3.0.0
Line: 432
public function display_popular_posts( $args = ... ): string;
| Type | Name | Description |
|---|---|---|
string|array | $args | { |
Returns: string — HTML table with popular posts.
get_period_total_visits()
Get the raw total visits for a period, matching the chart methodology.
Since: 4.3.0
Line: 538
public function get_period_total_visits( $args = ... ): int;
| Type | Name | Description |
|---|---|---|
array | $args | Query parameters (daily, from_date, to_date, blog_id, network). |
Returns: int — Total visits.
get_popular_posts()
Retrieve the popular posts.
Since: 3.0.0
Line: 605
public function get_popular_posts( $args = ... ): array;
| Type | Name | Description |
|---|---|---|
string|array | $args | { |
Returns: array — Array of post objects.
help_tabs()
Generates the help tabs.
Since: 3.0.0
Line: 713
public function help_tabs( );