Display
Display Class.
Namespace: WebberZone\Knowledge_Base\Frontend
Since: 2.3.0
Source: includes/frontend/class-display.php line 23
Methods
__construct()
Constructor class.
Since: 2.3.0
Line: 54
public function __construct( );
get_knowledge_base() static
The main function to generate the output.
Since: 2.3.0
Line: 94
static public function get_knowledge_base( $args = ... ): string;
| Type | Name | Description |
|---|---|---|
array | $args | { |
Returns: string — Knowledge Base output.
fetch_terms() static
Generic method to fetch terms with optional meta query filters.
Since: 2.3.0
Line: 213
static public function fetch_terms( $taxonomy, $query_args = ..., $meta_query = ... ): array|\WP_Error;
| Type | Name | Description |
|---|---|---|
string | $taxonomy | Taxonomy to query. |
array | $query_args | Base arguments for get_terms(). |
array | $meta_query | Optional meta query array. |
Returns: array|\WP_Error — Array of terms or WP_Error on failure.
render_product_sections() static
Render all top-level sections for a given product term ID.
Since: 3.0.0
Line: 274
static public function render_product_sections( int $product_id, array $args ): string;
| Type | Name | Description |
|---|---|---|
int | $product_id | Product term ID. |
array | $args | Arguments for display. |
Returns: string — Rendered HTML for sections.
get_knowledge_base_loop() static
Creates the knowledge base loop.
Since: 2.3.0
Line: 429
static public function get_knowledge_base_loop( int $term_id, int $level, bool $nested = ..., array $args = ... ): string;
| Type | Name | Description |
|---|---|---|
int | $term_id | Term ID. |
int | $level | Level of the loop. |
bool | $nested | Run recursive loops before closing HTML wrappers. |
array | $args | Parameters array. |
Returns: string — Formatted output.
get_term_posts() static
Returns query results for a specific term.
Since: 2.3.0
Line: 562
static public function get_term_posts( $term ): WP_Query;
| Type | Name | Description |
|---|---|---|
\WP_Term | $term | The Term. |
Returns: WP_Query — Query results for the given term.
get_posts_by_term() static
Formatted output of posts for a given term.
Since: 2.3.0
Line: 621
static public function get_posts_by_term( $term, int $level, array $args ): string;
| Type | Name | Description |
|---|---|---|
\WP_Term | $term | Current term. |
int | $level | Current level in the recursive loop. |
array | $args | Parameters array. |
Returns: string — HTML string of posts.
get_article_header() static
Get the article header.
Since: 2.3.0
Line: 645
static public function get_article_header( $term, int $level, array $args = ... ): string;
| Type | Name | Description |
|---|---|---|
\WP_Term | $term | Current term. |
int | $level | Current level in the recursive loop. |
array | $args | Parameters array. |
Returns: string — Formatted header output.
get_articles_loop() static
Creates the list of articles for a particular query results object.
Since: 2.3.0
Line: 677
static public function get_articles_loop( $term, int $level, WP_Query $query, array $args ): string;
| Type | Name | Description |
|---|---|---|
\WP_Term | $term | Current term. |
int | $level | Current level in the recursive loop. |
\WP_Query | $query | Query results object. |
array | $args | Parameters array. |
Returns: string — Formatted articles list.
get_article_footer() static
Footer of the articles list.
Since: 2.3.0
Line: 716
static public function get_article_footer( $term, int $level, WP_Query $query, array $args ): string;
| Type | Name | Description |
|---|---|---|
\WP_Term | $term | Current term. |
int | $level | Current level in the recursive loop. |
\WP_Query | $query | Query results object. |
array | $args | Parameters array. |
Returns: string — Formatted footer output.
get_categories_list() static
Get a hierarchical list of WZ Knowledge Base sections.
Since: 2.3.0
Line: 741
static public function get_categories_list( $term_id, $level = ..., $args = ... ): string;
| Type | Name | Description |
|---|---|---|
int | $term_id | Term ID. |
int | $level | Level of the loop. |
array | $args | Array of arguments. |
Returns: string — HTML output with the categories.
get_sections_by_product() static
Get top-level sections for a given product.
Since: 2.3.0
Line: 798
static public function get_sections_by_product( $product_id ): array;
| Type | Name | Description |
|---|---|---|
int | $product_id | Product term ID. |
Returns: array — Array of section term objects.
get_product_sections_list() static
Get a hierarchical list of sections for a given product.
Since: 2.3.0
Line: 839
static public function get_product_sections_list( $product_id, $args = ..., $level = ... ): string;
| Type | Name | Description |
|---|---|---|
int | $product_id | Product term ID. |
array | $args | Arguments for display. |
int | $level | Level of the loop (for indentation/nesting). |
Returns: string — HTML output.
get_sections_tree() static
Get a hierarchical list of sections, either for a specific term or a full products/sections tree.
Since: 3.0.0
Line: 879
static public function get_sections_tree( int $term_id, array $args = ... ): string;
| Type | Name | Description |
|---|---|---|
int | $term_id | Term ID (0 for full tree). |
array | $args | Display arguments. |
Returns: string — HTML output.
normalize_arguments() static
Normalize arguments for layout context.
Since: 3.0.0
Line: 935
static public function normalize_arguments( $args ): array;
| Type | Name | Description |
|---|---|---|
array | $args | Arguments to normalize. |
Returns: array — Normalized arguments.