wp-includes/class-wp-block-templates-registry.php:133Retrieves a registered template by its slug.
$template_slugstringWP_Block_Template|null public function get_by_slug( $template_slug ) { $all_templates = $this->get_all_registered(); if ( ! $all_templates ) { return null; } foreach ( $all_templates as $template ) { if ( $template->slug === $template_slug ) { return $template; } } return null; }Introduced in 6.7.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
src/wp-includes/class-wp-block-templates-registry.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.