Repository navigation
Abilities API: Declare the uri format for the link output of core/content-query - #15987
jorgefilipecosta wants to merge 2 commits into
Conversation
…e/content-query`. The `link` output of `core/users-query` declares the `uri` format, while the `core/content-query` permalink was a plain string. Declare the same format for the post permalink, so clients that check formats treat both links the same. Add coverage that a draft's plain `?p=ID` permalink, a published post's and a private page's pretty permalinks validate against the output schema. Follow-up to [64388]. See #66268.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
gziolo
left a comment
There was a problem hiding this comment.
Looks good. This aligns the link schema with core/users-query and the REST posts endpoint, with coverage for both pretty and plain permalinks.
|
Commit message: |
…e/content-query`. The post permalink in the `link` output was a plain string, while the `link` output of `core/users-query` declares the `uri` format. Declare the same format for the post permalink, so clients that check formats treat both links the same. The value is unchanged. Developed in #15987. Follow-up to [64388]. Props jorgefilipecosta, gziolo. Fixes #66268. git-svn-id: https://develop.svn.wordpress.org/trunk@65724 602fd350-edb4-49c9-b593-d223f7449a82
…e/content-query`. The post permalink in the `link` output was a plain string, while the `link` output of `core/users-query` declares the `uri` format. Declare the same format for the post permalink, so clients that check formats treat both links the same. The value is unchanged. Developed in WordPress/wordpress-develop#15987. Follow-up to [64388]. Props jorgefilipecosta, gziolo. Fixes #66268. Built from https://develop.svn.wordpress.org/trunk@65724 git-svn-id: http://core.svn.wordpress.org/trunk@64754 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…e/content-query`. The post permalink in the `link` output was a plain string, while the `link` output of `core/users-query` declares the `uri` format. Declare the same format for the post permalink, so clients that check formats treat both links the same. The value is unchanged. Developed in WordPress#15987. Follow-up to [64388]. Props jorgefilipecosta, gziolo. Fixes #66268. git-svn-id: https://develop.svn.wordpress.org/trunk@65724 602fd350-edb4-49c9-b593-d223f7449a82
…e/content-query`. The post permalink in the `link` output was a plain string, while the `link` output of `core/users-query` declares the `uri` format. Declare the same format for the post permalink, so clients that check formats treat both links the same. The value is unchanged. Developed in WordPress#15987. Follow-up to [64388]. Props jorgefilipecosta, gziolo. Fixes #66268. git-svn-id: https://develop.svn.wordpress.org/trunk@65724 602fd350-edb4-49c9-b593-d223f7449a82
Follow-up to https://core.trac.wordpress.org/changeset/64388.
This PR declares the
uriformat for thelinkoutput ofcore/content-query, like thelinkoutput ofcore/users-query:linkitem output property is astringwithformat: uri. Its value is unchanged: the post permalink.?p=IDlink) and a private page.Trac ticket: https://core.trac.wordpress.org/ticket/66268
Testing
Verify unit tests are passing:
Or read the ability schema in the editor console as an administrator:
Before:
{"type":"string","description":"The permalink URL."}After:
{"type":"string","format":"uri","description":"The permalink URL."}AI disclosure: the change and tests were drafted with AI assistance (Claude Code) and reviewed by me.