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

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

 Replying to [comment:2 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.

 Thanks, I thought the `permalink_template` was the generic value set when
 registering a post type or via the permalinks settings page.

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


More information about the wp-trac mailing list