Skip to content

feat: add moderation metadata fields to comments REST API endpoint#12

Open
xavierandueza wants to merge 1 commit into
masterfrom
xavierandueza/feature/update-post-comments
Open

feat: add moderation metadata fields to comments REST API endpoint#12
xavierandueza wants to merge 1 commit into
masterfrom
xavierandueza/feature/update-post-comments

Conversation

@xavierandueza
Copy link
Copy Markdown
Owner

Summary

  • Adds priority field (enum: low, normal, high, urgent) to the comments endpoint for moderation triage, stored as comment meta
  • Adds editorial_note string field for internal moderator notes, visible only in edit context
  • Adds computed word_count read-only field to comment responses
  • All new fields are supported on both create (POST /wp/v2/comments) and update (POST /wp/v2/comments/{id}) paths
  • Input values are properly sanitized via sanitize_key and sanitize_textarea_field

Changes

wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

  • get_item_schema(): Added schema definitions for the three new properties
  • create_item(): Saves priority and editorial_note as comment meta on creation
  • update_item(): Saves priority and editorial_note as comment meta on update
  • prepare_item_for_response(): Reads and returns all three new fields in API responses

Add priority, editorial_note, and word_count fields to the
wp/v2/comments endpoint. Priority and editorial_note are stored
as comment meta and accepted as input on create/update. Word count
is a computed read-only field derived from comment content.
@xavierandueza xavierandueza reopened this Feb 16, 2026
Repository owner deleted a comment from readme-pr-app Bot Feb 16, 2026
Repository owner deleted a comment from readme-pr-app Bot Feb 16, 2026
@xavierandueza xavierandueza reopened this Feb 17, 2026
@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Feb 17, 2026

📚 Documentation update workflow has been queued for reopened PR (Job ID: 6994ec0ba0f3185b35c7675c). The documentation bot will propose changes (if relevant) shortly.

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Feb 17, 2026

📊 PR Analysis Summary

Files Changed: 1 file(s)
Additions: +55 lines
Deletions: -0 lines

Changed Files
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php

Relevant Documentation Pages

Docs impacted by this PR
  • createcomment
  • listcomments
  • getcomment
  • updatecomment
  • updatepost
  • updatenavmenuitem
  • listposts
  • deletecomment
  • createnavmenuitem

✅ Documentation Changes Applied

🔗 View changes in ReadMe


This analysis was automatically generated by the ReadMe AI Documentation Bot.

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Feb 20, 2026

📚 Documentation Changes Applied

🔗 View changes in ReadMe

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Feb 26, 2026

📚 No documentation updates were needed for this PR.

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Feb 27, 2026

📚 Documentation Changes Applied

🔗 View changes in ReadMe

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Mar 1, 2026

📚 Documentation Changes Applied

🔗 View changes in ReadMe

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Mar 2, 2026

📚 Documentation Changes Applied

🔗 View changes in ReadMe

@readme-agent-staging
Copy link
Copy Markdown

📚 Analyzing PR for documentation updates...

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Mar 12, 2026

Documentation Changes Added

Page Section Action Preview
createcommentAPI Reference🔵 UpdatedPreview
updatecommentAPI Reference🔵 UpdatedPreview
listcommentsAPI Reference🔵 UpdatedPreview
getcommentAPI Reference🔵 UpdatedPreview
deletecommentAPI Reference🔵 UpdatedPreview

🔗 View all changes in ReadMe


Actions

  • Merge doc branch with PR merge
  • Delete doc branch with PR close

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Mar 26, 2026

Documentation Changes Added

Page Section Action Summary
updatecommentAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the Update a comment endpoint documentation including request body schema, code examples, response example, and TypeScript interfaces.
createcommentAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the Create a comment endpoint documentation including request body schema, code examples, response example, and TypeScript interfaces.
listcommentsAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the List comments response example and TypeScript interface to reflect new comment moderation metadata fields.
getcommentAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the Retrieve a comment response example and TypeScript interface to reflect new comment moderation metadata fields.
deletecommentAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the Delete a comment response example and TypeScript interface to reflect new comment moderation metadata fields in the previous object.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 2, 2026

Documentation Changes Added

Page Section Action Summary
listcommentsAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the response interface, response example, and OAS definition for the List comments endpoint.
createcommentAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the request body, response interface, code examples, response example, and OAS definition for the Create a comment endpoint.
getcommentAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the response interface, response example, and OAS definition for the Retrieve a comment endpoint.
updatecommentAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the request body, response interface, code examples, response example, and OAS definition for the Update a comment endpoint.
deletecommentAPI Reference📝 UpdatedAdded priority, editorial_note, and word_count fields to the response interface, response example (previous object), and OAS definition for the Delete a comment endpoint.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 8, 2026

Documentation Changes Added

Page Section Action Summary
listcommentsAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the List comments response interface, response example, and OAS definition.
createcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Create a comment request/response interfaces, response example, and OAS definition.
getcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Retrieve a comment response interface, response example, and OAS definition.
updatecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Update a comment request/response interfaces, response example, and OAS definition.
deletecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Delete a comment response interface, response example, and OAS definition.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

@xavierandueza xavierandueza marked this pull request as ready for review April 8, 2026 00:42
@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 8, 2026

Documentation Changes Added

Page Section Action Summary
listcommentsAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the List comments response schema, TypeScript interface, and response example.
createcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Create a comment request body, response schema, TypeScript interfaces, code examples, and response example.
getcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Retrieve a comment response schema, TypeScript interface, and response example.
updatecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Update a comment request body, response schema, TypeScript interfaces, code examples, and response example.
deletecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Delete a comment response schema, TypeScript interface, and response example.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 9, 2026

Documentation Changes Added

Page Section Action Summary
listcommentsAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to CommentResponse interface, response example, and OAS for the new moderation metadata fields.
createcommentAPI Reference📝 UpdatedAdd priority and word_count fields to the response JSON example.
getcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to CommentResponse interface, response example, and OAS for the new moderation metadata fields.
updatecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to request/response interfaces, response example, and OAS for the new moderation metadata fields.
deletecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to CommentResponse interface, response example, and OAS for the new moderation metadata fields.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 10, 2026

Documentation Changes Added

Page Section Action Summary
listcommentsAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the List comments endpoint response schema, TypeScript interface, and response example.
createcommentAPI Reference📝 UpdatedAdd priority and word_count fields to the Create a comment response example.
getcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Retrieve a comment endpoint response schema, TypeScript interface, and response example.
updatecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Update a comment endpoint request body, response schema, TypeScript interfaces, and response example.
deletecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Delete a comment endpoint response schema, TypeScript interface, and response example.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 24, 2026

Documentation Changes Added

Page Section Action Summary
listcommentsAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the List comments endpoint documentation, TypeScript interfaces, response examples, and OAS definition.
createcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Create a comment endpoint documentation, TypeScript interfaces, response examples, and OAS definition.
getcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Retrieve a comment endpoint documentation, TypeScript interface, response example, and OAS definition.
updatecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Update a comment endpoint documentation, TypeScript interfaces, response examples, and OAS definition.
deletecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the Delete a comment endpoint documentation, TypeScript interface, response example, and OAS definition.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

If neither actions are selected, on PR close/merge the docs branch in ReadMe will remain open.

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 24, 2026

Documentation Changes Added

Page Section Action Summary
listcommentsAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to TypeScript interface and response example for new comment moderation metadata fields.
createcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to TypeScript interfaces, response example, and OAS for new comment moderation metadata fields.
getcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to TypeScript interface, response example, and OAS for new comment moderation metadata fields.
updatecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to TypeScript interfaces and response example for new comment moderation metadata fields.
updatecommentAPI Reference📝 UpdatedAdd OAS definition with priority, editorial_note, and word_count fields for the update comment endpoint.
deletecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to TypeScript interface, response example, and OAS for new comment moderation metadata fields.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

If neither actions are selected, on PR close/merge the docs branch in ReadMe will remain open.

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 24, 2026

⚠️ The documentation bot was unable to process documentation updates (Job ID: 69eb1e4da00d51ea038b0a9c).

You can re-trigger by converting this PR to draft, then opening for review again.

@readme-pr-app
Copy link
Copy Markdown

readme-pr-app Bot commented Apr 24, 2026

Documentation Changes Added

Page Section Action Summary
listcommentsAPI Reference📝 UpdatedAdd priority and word_count fields to the response interface, response example, and OAS definition for the List comments endpoint.
createcommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the request params, response interface, response example, and OAS definition for the Create a comment endpoint.
getcommentAPI Reference📝 UpdatedAdd priority and word_count fields to the response interface, response example, and OAS definition for the Retrieve a comment endpoint.
updatecommentAPI Reference📝 UpdatedAdd priority, editorial_note, and word_count fields to the request params, response interface, response example, and OAS definition for the Update a comment endpoint.
deletecommentAPI Reference📝 UpdatedAdd priority and word_count fields to the response interface, response example, and OAS definition for the Delete a comment endpoint.

🔗 View all changes in ReadMe


Actions

  • Merge documentation branch with PR merge
  • Delete documentation branch with PR close

If neither actions are selected, on PR close/merge the docs branch in ReadMe will remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant