Admin_Columns
Admin Columns class.
Namespace: WebberZone\Knowledge_Base\Admin
Since: 2.3.0
Source: includes/admin/class-admin-columns.php line 22
Methods
__construct()
Main constructor class.
Since: 2.3.0
Line: 29
public function __construct( );
tax_columns() static
Customise the taxonomy columns.
Since: 2.3.0
Line: 62
static public function tax_columns( $columns ): array;
| Type | Name | Description |
|---|---|---|
array | $columns | Columns in the admin view. |
Returns: array — Updated columns.
tax_sortable_columns()
Make the Product column sortable.
Since: 3.0.0
Line: 84
public function tax_sortable_columns( $columns ): array;
| Type | Name | Description |
|---|---|---|
array | $columns | Array of sortable columns. |
Returns: array — Modified array of sortable columns.
tax_id() static
Add taxonomy ID and Product to the admin column.
Since: 2.3.0
Line: 99
static public function tax_id( $value, $name, $id ): int|string;
| Type | Name | Description |
|---|---|---|
string | $value | Deprecated. |
string | $name | Name of the column. |
int|string | $id | Category ID. |
Returns: int|string
sort_terms_by_product()
Sort wzkb_category terms by wzkb_product name.
Since: 3.0.0
Line: 128
public function sort_terms_by_product( $pieces, $taxonomies, $args ): array;
| Type | Name | Description |
|---|---|---|
array | $pieces | Array of query SQL clauses. |
array | $taxonomies | Array of taxonomy names. |
array | $args | Additional term query arguments. |
Returns: array — Modified clauses.
set_default_sections_order()
Ensure Sections screen defaults to sorting by Product.
Since: 3.0.0
Line: 173
public function set_default_sections_order( $query );
| Type | Name | Description |
|---|---|---|
\WP_Term_Query | $query | Term query instance. |
add_product_filter_dropdown()
Add product filter dropdown to Knowledgebase admin screen.
Since: 3.0.0
Line: 208
public function add_product_filter_dropdown( );
filter_articles_by_product()
Filter articles by the product in the admin.
Since: 3.0.0
Line: 256
public function filter_articles_by_product( $query );
| Type | Name | Description |
|---|---|---|
\WP_Query | $query | The current WP_Query instance (passed by reference). |
enqueue_sections_filter_script()
Enqueue script for product filter on Sections taxonomy screen.
Since: 3.0.0
Line: 297
public function enqueue_sections_filter_script( );
filter_sections_by_product()
Filter Sections by selected Product.
Since: 3.0.0
Line: 413
public function filter_sections_by_product( $pieces, $taxonomies ): array;
| Type | Name | Description |
|---|---|---|
array | $pieces | Array of query SQL clauses. |
array | $taxonomies | Array of taxonomy names. |
Returns: array — Modified query SQL clauses.