The term “block theme” is used a lot in WordPress but it was never really clear to me what that meant exactly from a code point of view.
While researching The post editor is going full iframe: what block developers need to know before WordPress 7.1, I learned that the outcome of testing WordPress 7.1 Beta 1 may soften the plan: instead of forcing the iframe for everyone, core might force it only for block themes, while classic themes using blocks with apiVersion 2 or lower keep the current 7.0 behavior. (The linked article covers the 7.0 state of things in full.)
If that’s the split, then the exact definition of “block theme” suddenly matters a great deal. So what does core actually check?
The public API is wp_is_block_theme(), which just asks the active theme:
// wp-includes/theme.php (guard clause trimmed)
function wp_is_block_theme() {
return wp_get_theme()->is_block_theme();
}
And WP_Theme::is_block_theme() is, in its entirety, a file-existence check:
// wp-includes/class-wp-theme.php (caching trimmed)
public function is_block_theme() {
$paths_to_index_block_template = array(
$this->get_file_path( '/templates/index.html' ),
$this->get_file_path( '/block-templates/index.html' ),
);
foreach ( $paths_to_index_block_template as $path ) {
if ( is_file( $path ) && is_readable( $path ) ) {
return true;
}
}
return false;
}
A theme is a “block theme” if it ships an index.html block template, either in templates/, or in block-templates/, the pre-5.9 legacy location. Nothing else is consulted. That has a few consequences that may surprise people:
theme.json doesn’t make you a block theme. Neither do patterns, block template parts, or add_theme_support( 'block-templates' ). A theme can adopt every one of those “hybrid” features and still land on the classic side of this check, because the test only looks for a top-level index.html template.
Child themes inherit the answer. get_file_path() looks in the child theme first and falls back to the parent, so a child theme of a block theme is a block theme even if the child ships no templates of its own.
It’s a filesystem check, not a declaration. There’s no header in style.css that opts you in or out. Drop a templates/index.html into a theme and, as far as WordPress is concerned, it is a block theme.
The minimum files required for block and classic themes
This is the entire minimum viable block theme — two files:
my-block-theme/
├── style.css ← standard theme header
└── templates/
└── index.html ← this file IS the decider
(WordPress considers a theme valid if it has style.css plus either index.php or templates/index.html, which means for a block theme, index.php, functions.php, and even theme.json are all optional.)
And this is a theme that is guaranteed to stay classic:
my-classic-theme/
├── style.css
└── index.php ← the classic fallback template
Staying on the classic side of the check comes down to two conditions:
- No
templates/index.htmland no legacyblock-templates/index.html. Other block templates don’t matter: a theme with `templates/single.html` but no `templates/index.html` still tests as classic. (In practice, though, if you’re shipping block templates, ship the index and be a block theme on purpose.) - No block-theme parent. The check falls back to the parent theme, so a child of Twenty Twenty-Five is a block theme no matter what the child contains. To be classic, the whole chain has to be.
Everything else is fair game. theme.json, patterns, add_theme_support( 'block-template-parts' )` custom templates registered from plugins — none of them flip the switch., patterns, add_theme_support( 'block-template-parts' ), custom templates registered from plugins: none of them flip the switch.
Where real themes land
Running that check against some current releases from the theme directory
| Tests classic | Tests block |
|---|---|
| Twenty Twenty-One and every earlier default | Twenty Twenty-Two and every later default |
Astra, Kadence, Blocksy, Botiga, Sydney, Hello Elementor — all ship theme.json |
|
| GeneratePress, Neve, OceanWP, Storefront |
Six of the themes in the first column ship theme.json, the marquee “block” feature, and still test classic, because the check never looks at theme.json
Twenty Twenty and OceanWP are another good gotcha: both ship a templates/ directory and are still classic, because it’s full of PHP page templates (template-cover.php, landing.php). The check wants templates/index.html specifically, so “does it have a templates folder” is not the indicator you might assume.
How the editor reads it
On the JavaScript side, the block-theme flag surfaces in two different places, which is worth knowing if you go source-diving.
As an editor setting:
// wp-includes/block-editor.php, get_block_editor_settings()
$editor_settings['__unstableIsBlockBasedTheme'] = wp_is_block_theme();
and on the REST themes endpoint, which is where @wordpress/core-data picks it up:
// wp-includes/rest-api/endpoints/class-wp-rest-themes-controller.php
$data['is_block_theme'] = $theme->is_block_theme();
The one-file switch
For all the weight the term carries, “block theme” boils down to a single file: templates/index.html exists, or it doesn’t. Not theme.json, not patterns, not any amount of hybrid adoption. Just one index template, checked up the parent chain.
That’s worth keeping in mind if 7.1 does end up drawing the iframe line at wp_is_block_theme(). A hybrid theme that has adopted everything except block templates would keep the classic editor behavior, while adding a single templates/index.html (even accidentally, even in a parent theme you don’t control) would flip a site to the forced iframe. If your theme or your users’ sites sit anywhere near that line, now is a good time to check which side of it you’re actually on: it’s one is_file() call away.
Discover more from Complete Nursing Solution
Subscribe to get the latest posts sent to your email.
Votre site est rapide et fluide.
Je partage votre article sur les réseaux sociaux.
Do you have any tutorials available?
Avez-vous des disponibilités pour un projet ?
Great article, thanks for sharing!
I am curious to learn more about you.
Do you have any promotional offers?
I would like to subscribe to your blog.
I am a big fan of your work.
Je partage votre article sur les réseaux sociaux.
I see that you are using WordPress.
J’adore la navigation de votre site.
Could you give me more details?
Votre expertise est impressionnante.
J’aimerais collaborer avec vous.
Je trouve votre approche très intéressante.
Avez-vous une version mobile de votre site ?
I really appreciate your content.
Votre site est très professionnel.
Je suis intéressé par vos services.
I am curious to learn more about you.
I completely agree with your analysis.
Congratulations on your website!
Do you have additional sources to share?
I love your site’s navigation.
Do you have any upcoming events?
Je peux vous aider à améliorer votre SEO.
Votre site est très professionnel.
Votre site est très professionnel.
J’aimerais collaborer avec vous.
I am curious to learn more about you.
Would you like a free SEO audit?
Are you planning to add an online store?
Proposez-vous des services de rédaction ?
Pouvez-vous me faire un devis ?
I am a big fan of your work.
Continuez comme ça.
I recommend your site to my colleagues.
I am curious to learn more about you.
I am interested in your services.
I am a big fan of your work.
Je recommande votre site à mes collègues.
Your blog is a goldmine of information.
Hello, I am contacting you.
Avez-vous des disponibilités pour un projet ?
Hello, I am impressed by your WordPress website.
Your site is fast and smooth.
Do you have additional sources to share?
Continuez à produire du contenu de qualité.
I look forward to reading your next articles.
Do you need help managing your plugins?
Your website is very beautiful!
Do you have additional sources to share?
I see that you are using WordPress.
Votre site est très beau !
Je peux vous aider à améliorer votre SEO.
Avez-vous une newsletter ?
Pouvez-vous me faire un devis ?
Très bon article, merci pour le partage !
Je partage votre article sur les réseaux sociaux.
I would be happy to make you a proposal.
Avez-vous des sources supplémentaires à partager ?
Je souhaite m’abonner à votre blog.
I would like to subscribe to your blog.
Félicitations pour votre site !
Je recommande votre site à mes collègues.
Do you have additional sources to share?
Do you have any tutorials available?
Pouvez-vous me faire un devis ?
Keep producing quality content.
I find your approach very interesting.
Pouvez-vous me faire un devis ?
Do you need help with your website security?
Do you need help managing your plugins?
Your expertise is impressive.
Your website is very beautiful!
Avez-vous des sources supplémentaires à partager ?
Votre design est moderne et épuré.
Proposez-vous des formations ?
I would be happy to make you a proposal.
I would like to collaborate with you.
Do you offer training courses?
Proposez-vous des services de rédaction ?
Félicitations pour votre site !
Thanks for this quality content.
Do you have any upcoming events?
Do you have a newsletter?
Pouvez-vous me faire un devis ?
J’apprécie beaucoup votre contenu.
Hello, I am impressed by your WordPress website.
Votre design est moderne et épuré.
Pensez-vous à une refonte ou à des améliorations de performance ?
Hello, I am contacting you.
Pensez-vous à une refonte ou à des améliorations de performance ?
Bonjour, je me permets de vous contacter.
Votre expertise est impressionnante.
Bonjour, je me permets de vous contacter.
Je suis curieux d’en savoir plus sur vous.
Je suis impatient de lire vos prochains articles.
Hello, I represent a digital agency.
Ai đang tìm hiểu thì có thể ghé https://fly88.co.com/ để xem thêm chi tiết.
Do you have availability for a project?
Your site is fast and smooth.
Je trouve votre approche très intéressante.
I am sharing your article on social media.
Do you have any tutorials available?
Avez-vous des événements à venir ?
Do you have a newsletter?
Do you have any upcoming events?
Bonjour, je suis impressionné par votre site WordPress.
Would you like a free SEO audit?
Je partage votre article sur les réseaux sociaux.
Avez-vous des événements à venir ?
I recommend your site to my colleagues.
Je trouve votre approche très intéressante.
Could you give me more details?
Your website is very beautiful!
Your site is fast and smooth.
Do you offer writing or content services?
Do you have additional sources to share?
I am sharing your article on social media.
Do you need help managing your plugins?
I am sharing your article on social media.
Proposez-vous des services de rédaction ?
Bonjour, je représente une agence digitale.
Votre design est moderne et épuré.
Great article, thanks for sharing!
Avez-vous des offres promotionnelles ?
Your expertise is impressive.
Je suis tout à fait d’accord avec votre analyse.
Keep up the good work.
Do you have any upcoming events?
Très bon article, merci pour le partage !
Merci pour ces informations précieuses.
Proposez-vous des services de rédaction ?
Avez-vous des sources supplémentaires à partager ?
Avez-vous une version mobile de votre site ?
Je suis impatient de lire vos prochains articles.
I am curious to learn more about you.
Would you like a free SEO audit?
Continuez à produire du contenu de qualité.
Souhaiteriez-vous un audit gratuit de votre référencement ?
I see that you are using WordPress.
Your design is modern and clean.
Votre site est très beau !
Très bon article, merci pour le partage !
Félicitations pour votre site !
J’apprécie beaucoup votre contenu.
Merci pour ces informations précieuses.
Do you have a newsletter?
Je trouve votre approche très intéressante.
Do you need help with your website security?
Continuez à produire du contenu de qualité.
Your design is modern and clean.
Do you have any tutorials available?
Bonjour, je me permets de vous contacter.
Are you planning to add an online store?
Avez-vous des événements à venir ?
Your blog is a goldmine of information.
Can you give me a quote?
Dans le cadre d’un projet, je recherche des informations.
Your site is fast and smooth.
I find your approach very interesting.
Souhaiteriez-vous un audit gratuit de votre référencement ?
Je recommande votre site à mes collègues.
Pouvez-vous me faire un devis ?
Dans le cadre d’un projet, je recherche des informations.
I love your site’s navigation.
I would like to collaborate with you.
Je peux vous aider à améliorer votre SEO.
Je partage votre article sur les réseaux sociaux.
Your work is truly inspiring.
Your design is modern and clean.
Congratulations on your website!
Do you have additional sources to share?
Je partage votre article sur les réseaux sociaux.
Avez-vous besoin d’aide pour la sécurité de votre site ?
Je suis tout à fait d’accord avec votre analyse.
I would be happy to make you a proposal.
Do you offer training courses?
Je partage votre article sur les réseaux sociaux.
Hello, I am contacting you.
Do you offer writing or content services?
I am sharing your article on social media.
Avez-vous des offres promotionnelles ?
J’aimerais collaborer avec vous.
Merci pour ce contenu de qualité.
Do you have availability for a project?
Je partage votre article sur les réseaux sociaux.
Would you like a free SEO audit?
Your design is modern and clean.
Avez-vous des offres promotionnelles ?
Do you have additional sources to share?
I am a big fan of your work.
J’apprécie beaucoup votre contenu.
Are you considering a redesign or performance improvements?
Félicitations pour votre site !
Do you have a newsletter?
Are you considering a redesign or performance improvements?
I am interested in your services.
Your work is truly inspiring.
Je suis un grand fan de votre travail.
Pensez-vous à une refonte ou à des améliorations de performance ?
Do you have any upcoming events?
Do you offer training courses?
Souhaiteriez-vous un audit gratuit de votre référencement ?
Bonjour, je me permets de vous contacter.
Your website is very professional.
Avez-vous besoin d’aide pour la sécurité de votre site ?
Thanks for this valuable information.
[7346]Kirkiya Official Login | সেরা অনলাইন ক্যাসিনো ও স্লট গেমস,kirkiya প্ল্যাটফর্মে লগইন করে সেরা অনলাইন casino গেমস উপভোগ করুন। বিকাশ দিয়ে টাকা জমা দিয়ে সহজেই স্লট গেম শুরু করুন। আজই অ্যাপটি ডাউনলোড করুন। visit: kirkiya