[wp-trac] [WordPress Trac] #45017: REST API: Expose permalink_template in the Posts controller
WordPress Trac
noreply at wordpress.org
Wed Oct 3 19:27:40 UTC 2018
#45017: REST API: Expose permalink_template in the Posts controller
------------------------------------------+-----------------------
Reporter: danielbachhuber | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 5.0
Component: REST API | Version:
Severity: normal | Resolution:
Keywords: needs-patch needs-unit-tests | Focuses: rest-api
------------------------------------------+-----------------------
Comment (by danielbachhuber):
Thanks @rahulsprajapati
A couple points of feedback on the patch:
1. The `permalink_template` and `generated_slug` attributes both need to
be defined on the object's schema, but only when the post type is public
and viewable. See:
* https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-admin/edit-
form-advanced.php#L101
* https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-admin/edit-
form-advanced.php#L600
2. The `permalink_template` and `generated_slug` attributes should
''always'' be added to the response, as they're dynamically removed by the
call to `$this->filter_response_by_context()`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45017#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list