Automattic\WooCommerce\Blocks
BlockTemplatesController::get_templates_directory()
Gets the directory where templates of a specific template type can be found.
Method of the class: BlockTemplatesController{}
No Hooks.
Return
String
.
Usage
// protected - for code of main (parent) or child class $result = $this->get_templates_directory( $template_type );
- $template_type(string)
- wp_template or wp_template_part.
Default: 'wp_template'
BlockTemplatesController::get_templates_directory() BlockTemplatesController::get templates directory code WC 7.7.0
protected function get_templates_directory( $template_type = 'wp_template' ) { if ( 'wp_template_part' === $template_type ) { return $this->template_parts_directory; } // When the blockified Product Grid Block will be implemented, we need to use the blockified templates. // if ( $this->package->is_experimental_build() && BlockTemplateUtils::should_use_blockified_product_grid_templates() ) { // return $this->templates_directory . '/blockified'; // }. return $this->templates_directory; }