Description
Ever since Gutenberg Plugin v13.9+ the simple existence of the theme.json file in the theme causes the template label to always say Default Template if its been set to a custom PHP template. Clicking on the Label to open the popup still correctly shows which template is actually set for the page.
I came across this PR #42091 when looking to see if anyone has had similar experiences. The comment by noisysocks in that conversation is the exact issue im having but based on the remainder of the conversation, i assume it was fixed before merge. There is some discussion at the bottom about settings.availableTemplates[] but I cant find any documentation on that anywhere. Is this something I need in my theme.json to define my PHP templates? Do i have to disable block templates? Id like to have the ability to have both block and classic as im primarily developing in a hybrid approach.
At this point im not 100% sure if this is still a bug or if Im just missing something somewhere.
Ive created a simple theme with just a basic index.php, style.css, theme.json and custom-template.php so there are no conflicts anywhere.

If I remove the theme.json file from the theme, then it shows up correctly.

This only appears to affect classic PHP templates. As below I created an FSE Template and it works as expected even with the theme.json in the theme.

Step-by-step reproduction instructions
- Go to page
- Click on template title
- Cange to custom PHP template
- Template title does not change to reflect chosen template
Screenshots, screen recording, code snippet



Environment info
- Wordpress - v6.0.3
- Gutenberg - v13.9+
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
Description
Ever since Gutenberg Plugin v13.9+ the simple existence of the
theme.jsonfile in the theme causes the template label to always say Default Template if its been set to a custom PHP template. Clicking on the Label to open the popup still correctly shows which template is actually set for the page.I came across this PR #42091 when looking to see if anyone has had similar experiences. The comment by noisysocks in that conversation is the exact issue im having but based on the remainder of the conversation, i assume it was fixed before merge. There is some discussion at the bottom about
settings.availableTemplates[]but I cant find any documentation on that anywhere. Is this something I need in my theme.json to define my PHP templates? Do i have to disable block templates? Id like to have the ability to have both block and classic as im primarily developing in a hybrid approach.At this point im not 100% sure if this is still a bug or if Im just missing something somewhere.
Ive created a simple theme with just a basic
index.php,style.css,theme.jsonandcustom-template.phpso there are no conflicts anywhere.If I remove the
theme.jsonfile from the theme, then it shows up correctly.This only appears to affect classic PHP templates. As below I created an FSE Template and it works as expected even with the
theme.jsonin the theme.Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes