Columns
Admin Columns Class.
Namespace: WebberZone\Top_Ten\Admin
Since: 3.3.0
Source: includes/admin/class-columns.php line 24
Methods
__construct()
Constructor class.
Since: 3.3.0
Line: 31
public function __construct( );
add_columns() static
Add an extra column to the All Posts page to display the page views.
Line: 67
static public function add_columns( $cols ): array;
| Type | Name | Description |
|---|---|---|
array | $cols | Array of all columns on posts page. |
Returns: array — Modified array of columns.
get_value() static
Display page views for each column.
Since: 4.0.0
Line: 88
static public function get_value( $column_name, $id );
| Type | Name | Description |
|---|---|---|
string | $column_name | Name of the column. |
int|string | $id | Post ID. |
add_columns_register_sortable() static
Register the columns as sortable.
Since: 1.9.8.2
Line: 169
static public function add_columns_register_sortable( $cols ): array;
| Type | Name | Description |
|---|---|---|
array | $cols | Array with column names. |
Returns: array — Filtered columns array
add_columns_clauses() static
Add custom post clauses to sort the columns.
Since: 3.3.0
Line: 188
static public function add_columns_clauses( $clauses, $wp_query ): array;
| Type | Name | Description |
|---|---|---|
array | $clauses | Lookup clauses. |
\WP_Query | $wp_query | WP Query object. |
Returns: array — Filtered clauses
admin_css() static
Output CSS for width of new column.
Since: 1.2
Line: 240
static public function admin_css( );