_add_block_template_part_area_info example

$template_base_paths = get_block_theme_folders( $theme_slug );
        $file_path           = $theme_dir . '/' . $template_base_paths[ $template_type ] . '/' . $slug . '.html';
        if ( file_exists( $file_path ) ) {
            $new_template_item = array(
                'slug'  => $slug,
                'path'  => $file_path,
                'theme' => $theme_slug,
                'type'  => $template_type,
            );

            if ( 'wp_template_part' === $template_type ) {
                return _add_block_template_part_area_info( $new_template_item );
            }

            if ( 'wp_template' === $template_type ) {
                return _add_block_template_info( $new_template_item );
            }

            return $new_template_item;
        }
    }

    return null;
}
Home | Imprint | This part of the site doesn't use cookies.