Template_Handler
Class Template_Handler
Handles template-related functionalities for the Knowledge Base plugin. Delegates block template management to Block_Template_Manager.
Namespace: WebberZone\Knowledge_Base\Frontend
Source: includes/frontend/class-template-handler.php line 18
Methods
__construct()
Constructor for the Template_Handler class.
Line: 39
public function __construct( );
archive_template()
Replace the archive template for the knowledge base (classic themes only).
Filters template_include to load custom PHP templates for classic themes. Block themes are handled by Block_Template_Manager.
To customize these archive views, create a new template file in your theme’s folder: archive-wz_knowledgebase.php (Main KB archives), wzkb-category.php (Category/Section archives), wzkb-search.php (Search results page) or taxonomy-wzkb_tag.php (Tag archives)
Since: 2.3.0
Line: 68
public function archive_template( $template ): string;
| Type | Name | Description |
|---|---|---|
string |
$template |
Default Archive Template location. |
Returns: string — Modified Archive Template location
posts_per_search_page()
Set the number of results on the knowledge base search results page.
Applies to the main query and to secondary queries that don’t set their own page size, such as the one the search templates build. Queries that set posts_per_page, such as the REST search endpoint, keep their own limit.
Since: 2.3.0
Line: 118
public function posts_per_search_page( $query ): \WP_Query;
| Type | Name | Description |
|---|---|---|
\WP_Query |
$query |
The search query object. |
Returns: \WP_Query — $query Updated search query object
update_title()
Update the title on WZKB archive.
Since: 2.3.0
Line: 148
public function update_title( $title ): array;
| Type | Name | Description |
|---|---|---|
array |
$title |
Title of the page. |
Returns: array — Updated title
register_sidebars()
Register the WZ Knowledge Base sidebars.
Since: 2.3.0
Line: 162
public function register_sidebars( );