[wp-trac] [WordPress Trac] #45017: REST API: Expose permalink_template in the Posts controller

WordPress Trac noreply at wordpress.org
Wed Oct 3 11:18:49 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):

 Replying to [comment:1 sanchothefat]:
 > Question: shouldn't this information be part of the ''Post Types''
 controller responses if not just exposed via `wp_localize_script()` or
 similar?

 The Posts controller seems to make most sense at this point. The value of
 both `permalink_template` and `generated_slug` are dependent on the
 ''computed'' value of `$post->ID` and `$post->post_title`, and could vary
 from post to post (e.g. through filters).

 Also, we want to expose this information through the REST API so that
 other clients (e.g. mobile apps) have access to it. `wp_localize_script()`
 doesn't provide this for us.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45017#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list