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()
For knowledge base search results, set posts_per_page 10.
Since: 2.3.0
Line: 114
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: 133
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: 147
public function register_sidebars( );