You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When editing a template, we discovered that getCurrentPostId was not returning an integer, causing the Notes feature to malfunction. However, I later realized that when a template is duplicated, the post ID of the duplicated template is an integer.
This may indicate that it might be possible to use the notes feature even within templates.
What is your proposed solution?
Let's investigate any technical obstacles or issues and see if we can add the notes feature to templates.
After investigating this further, here are my findings and observations regarding enabling Notes for default WordPress templates:
Custom templates and template parts: Notes work perfectly when users create new templates or template parts in the Site Editor since these are stored in the database and return a numeric postId.
Default WordPress templates: Notes do not work because getCurrentPostId() returns a string such as twentytwentyfive//archive. This happens because default templates (like home.html, index.html, etc.) are file-based and not stored in the database.
Even if we “materialize” these templates (create DB records programmatically for each default template), the Site Editor still references the file-based template and does not recognize the DB record. Therefore, the non-numeric postId issue persists.
Since Notes intentionally restrict non-numeric post IDs (for data consistency and REST API reasons), this prevents Notes from being used in default templates.
Looking forward to the core team’s feedback on the best way forward.
Default WordPress templates: Notes do not work because getCurrentPostId() returns a string such as twentytwentyfive//archive. This happens because default templates (like home.html, index.html, etc.) are file-based and not stored in the database.
In the latest Gutenberg, we first need to duplicate the built-in template in order to edit it. This means the post ID should be a number. What do you think?
In the latest Gutenberg, we first need to duplicate the built-in template in order to edit it. This means the post ID should be a number. What do you think?
Yes, that makes sense — with the new templating system requiring duplication before editing, the templates will have numeric post IDs, making Notes support more feasible.
As part of my testing, I’ve already verified that adding wp_template to the supported post types in gutenberg_block_comment_add_post_type_support() successfully enables Notes for duplicated templates.
Would you be open to me creating a small PR to include this enhancement so we can enable Notes for those post types in the interim?
Unlink the project board from this issue because the parent issue, #73260, has already been added to the 7.0 project board. Moving this issue to the 7.0 project board.
If with template API you mean template activation, that's stalled without agreement, so please don't wait for that. I should close that tracking issue. We should also remove the experiment at some point but it's hard without user intervention.
Activity
Mamaduka commentedon Nov 3, 2025
There's also post type supports check and templates/template parts don't support the Notes feature.
karthick-murugan commentedon Nov 7, 2025
After investigating this further, here are my findings and observations regarding enabling Notes for default WordPress templates:
Custom templates and template parts: Notes work perfectly when users create new templates or template parts in the Site Editor since these are stored in the database and return a numeric postId.
Default WordPress templates: Notes do not work because getCurrentPostId() returns a string such as twentytwentyfive//archive. This happens because default templates (like home.html, index.html, etc.) are file-based and not stored in the database.
Even if we “materialize” these templates (create DB records programmatically for each default template), the Site Editor still references the file-based template and does not recognize the DB record. Therefore, the non-numeric postId issue persists.
Since Notes intentionally restrict non-numeric post IDs (for data consistency and REST API reasons), this prevents Notes from being used in default templates.
Looking forward to the core team’s feedback on the best way forward.
t-hamano commentedon Nov 11, 2025
In the latest Gutenberg, we first need to duplicate the built-in template in order to edit it. This means the post ID should be a number. What do you think?
Mamaduka commentedon Nov 11, 2025
Yes, with new templating system and UX. This will be more doable. Hopefully it will ship with WP 7.0 and we can ship this as well.
karthick-murugan commentedon Nov 11, 2025
Thank you, @t-hamano and @Mamaduka, for the clarification! 🙏
Yes, that makes sense — with the new templating system requiring duplication before editing, the templates will have numeric post IDs, making Notes support more feasible.
As part of my testing, I’ve already verified that adding wp_template to the supported post types in gutenberg_block_comment_add_post_type_support() successfully enables Notes for duplicated templates.
Would you be open to me creating a small PR to include this enhancement so we can enable Notes for those post types in the interim?
t-hamano commentedon Jan 6, 2026
Unlink the project board from this issue because the parent issue, #73260, has already been added to the 7.0 project board.Moving this issue to the 7.0 project board.7 remaining items
adamsilverstein commentedon Jul 8, 2026
@t-hamano what is the status of the template API?
t-hamano commentedon Jul 8, 2026
As far as I recall, there hasn't been any significant progress on the Template API. It's also not listed on the 7.1 roadmap.
@annezazu @ellatrix, Are there plans to resume development of the Template API for a future release?
annezazu commentedon Jul 9, 2026
This is the latest: #71735 There needs to be more agreement on design and UX before proceeding technically.
[-]Notes: Make it available in templates[/-][+]Make Notes available in templates[/+]ellatrix commentedon Aug 13, 2026
If with template API you mean template activation, that's stalled without agreement, so please don't wait for that. I should close that tracking issue. We should also remove the experiment at some point but it's hard without user intervention.