-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Labels
[Feature] Templates APIRelated to API powering block template functionality in the Site EditorRelated to API powering block template functionality in the Site Editor[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
After the release of 21.8.0 we started getting test failures in wordpress-rs because the schema format for templates had changed.
I've narrowed it down to #72029, specifically this change. This check in #72141 seems to further contribute to the problem, as $post_arr['id'] is never an int for built-in templates.
Step-by-step reproduction instructions
- Create a new WordPress site (it should use
twentytwentyfiveas the theme – this one has templates, so it'll demonstrate the problem) - Set up permalinks
- Fetch
wp-json/wp/v2/templates - Note that the
themefield for each template istwentytwentyfive. - Install the "Gutenberg" plugin (21.8.0 or greater)
- Fetch
wp-json/wp/v2/templates - Note that the
themefield for each template isnull - Comment out lines 35-53 (inclusive) in
wp-content/plugins/gutenberg/lib/compat/wordpress-6.9/template-activate.php - Fetch
wp-json/wp/v2/templates - Note that the
themefield for each template istwentytwentyfive.
Screenshots, screen recording, code snippet
No response
Environment info
- WP 6.8.3
- Gutenberg 21.8.0
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
Please confirm which theme type you used for testing.
- Block
- Classic
- Hybrid (e.g. classic with theme.json)
- Not sure
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
[Feature] Templates APIRelated to API powering block template functionality in the Site EditorRelated to API powering block template functionality in the Site Editor[Status] In ProgressTracking issues with work in progressTracking issues with work in progress[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
✅ Done