Recent

Display class

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;
TypeNameDescription
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;
TypeNameDescription
string$taxonomyTaxonomy to query.
array$query_argsBase arguments for get_terms().
array$meta_queryOptional 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;
TypeNameDescription
int$product_idProduct term ID.
array$argsArguments 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;
TypeNameDescription
int$term_idTerm ID.
int$levelLevel of the loop.
bool$nestedRun recursive loops before closing HTML wrappers.
array$argsParameters 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;
TypeNameDescription
\WP_Term$termThe 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;
TypeNameDescription
\WP_Term$termCurrent term.
int$levelCurrent level in the recursive loop.
array$argsParameters 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;
TypeNameDescription
\WP_Term$termCurrent term.
int$levelCurrent level in the recursive loop.
array$argsParameters 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;
TypeNameDescription
\WP_Term$termCurrent term.
int$levelCurrent level in the recursive loop.
\WP_Query$queryQuery results object.
array$argsParameters 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;
TypeNameDescription
\WP_Term$termCurrent term.
int$levelCurrent level in the recursive loop.
\WP_Query$queryQuery results object.
array$argsParameters 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;
TypeNameDescription
int$term_idTerm ID.
int$levelLevel of the loop.
array$argsArray 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;
TypeNameDescription
int$product_idProduct 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;
TypeNameDescription
int$product_idProduct term ID.
array$argsArguments for display.
int$levelLevel 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;
TypeNameDescription
int$term_idTerm ID (0 for full tree).
array$argsDisplay 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;
TypeNameDescription
array$argsArguments to normalize.

Returns: array — Normalized arguments.