Recent

Block_Template_Manager class

Block_Template_Manager

Class Block_Template_Manager

Manages block template registration using native WordPress 6.7+ API with fallback support for pre-6.7 versions.

Namespace: WebberZone\Knowledge_Base\Frontend
Source: includes/frontend/class-block-template-manager.php line 21

Methods

__construct()

Constructor for Block_Template_Manager.

Line: 47

public function __construct(  );

add_search_template_to_hierarchy()

Add wzkb-search to the block template hierarchy for KB search pages.

Line: 71

public function add_search_template_to_hierarchy( array $templates ): array;
TypeNameDescription
string[]$templatesOrdered list of template slugs to look for.

Returns: array — Modified list of template slugs.

register_block_templates()

Register block templates using native WordPress 6.7+ API.

Line: 82

public function register_block_templates(  );

inject_legacy_templates()

Inject templates for pre-6.7 WordPress versions.

Line: 98

public function inject_legacy_templates( $query_result, $query, $template_type ): array;
TypeNameDescription
array$query_resultArray of found block templates.
array$queryArguments to retrieve templates.
string$template_typeTemplate type (wp_template or wp_template_part).

Returns: array — Updated array of found block templates.