Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

LLMS_Block_Templates::block_templates_from_fs( string[] $block_templates_paths, string[] $slugs = array() )

Get block templates from the file system.

Parameters Parameters


(string[]) (Required) Array of block templates paths to look for templates.


(string[]) (Optional) Arrray of template slugs to be retrieved.

Default value: array()

Top ↑

Return Return


Top ↑

Source Source

File: includes/class-llms-block-templates.php

	private function block_templates_from_fs( $block_templates_paths, $slugs = array() ) {

		$templates = array();

		foreach ( $block_templates_paths as $template_file ) {
			$template_slug = $this->generate_template_slug_from_path( $template_file );
			if ( ! empty( $slugs ) && ! in_array( $template_slug, $slugs, true ) ) {
			$templates[] = $this->build_template_result_from_file( $template_file, $template_slug );

		return $templates;


Top ↑

Changelog Changelog

Version Description
5.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.