Skip to content

Make Notes available in templates #72918

Open

Description

@t-hamano

Related resources:

What problem does this address?

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.

Activity

  1. Mamaduka commented on Nov 3, 2025

    @Mamaduka
    Member

    There's also post type supports check and templates/template parts don't support the Notes feature.

  2. moved this to 🦵 Punted to 7.0 in WordPress 6.9 Editor Taskson Nov 4, 2025
  3. karthick-murugan commented on Nov 7, 2025

    @karthick-murugan
    Contributor

    After investigating this further, here are my findings and observations regarding enabling Notes for default WordPress templates:

    1. 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.

    2. 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.

    3. 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.

  4. t-hamano commented on Nov 11, 2025

    @t-hamano
    ContributorAuthor
    1. 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?

  5. Mamaduka commented on Nov 11, 2025

    @Mamaduka
    Member

    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.

  6. karthick-murugan commented on Nov 11, 2025

    @karthick-murugan
    Contributor

    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?

    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?

  7. t-hamano commented on Jan 6, 2026

    @t-hamano
    ContributorAuthor

    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.

  8. 7 remaining items

  9. adamsilverstein commented on Jul 8, 2026

    @adamsilverstein
    Member

    Until the new template API is stabilized, it will be difficult to move this issue forward, so let's remove it from the project board.

    @t-hamano what is the status of the template API?

  10. t-hamano commented on Jul 8, 2026

    @t-hamano
    ContributorAuthor

    what is the status of the template API?

    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?

  11. annezazu commented on Jul 9, 2026

    @annezazu
    Contributor

    This is the latest: #71735 There needs to be more agreement on design and UX before proceeding technically.

  12. changed the title [-]Notes: Make it available in templates[/-] [+]Make Notes available in templates[/+] on Jul 21, 2026
  13. moved this from 🦵 Punted to 7.2 to 🏗️ In Progress in WordPress 7.1 Editor Taskson Aug 12, 2026
  14. ellatrix commented on Aug 13, 2026

    @ellatrix
    Member

    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.

  15. moved this to 🏗️ In Progress in WordPress 7.2 Editor Taskson Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

[Feature] NotesPhase 3 of the Gutenberg roadmap around block commenting[Status] In ProgressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions