#4852 closed enhancement (fixed)
Add ID to the API
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Component: | WordPress.tv | Keywords: | |
| Cc: |
Description
Please add also the ID of the taxonomy/category so it could be used by external tools to submit a video to WordPress.tv (e.g. the submit-video form needs the category IDs for WordCampTV, Europe, 2019)
The code to be changed is in /themes/wptv2/plugins/wordpresstv-rest/wordpresstv-rest.php
Change
foreach ( $terms as $t ) {
$item = array(
'name' => $t->name,
'link' => get_term_link( $t ),
'api' => add_query_arg( $taxonomy_obj->query_var, $t->slug, home_url( '/api/videos.json') ),
'videos' => $t->count,
);
to
foreach ( $terms as $t ) {
$item = array(
'id' => $t->term_id,
'name' => $t->name,
'link' => get_term_link( $t ),
'api' => add_query_arg( $taxonomy_obj->query_var, $t->slug, home_url( '/api/videos.json') ),
'videos' => $t->count,
);
Change History (3)
#3
@
6 years ago
For some things like this, the WordPress Rest API is probably a better option: https://public-api.wordpress.com/rest/v1.1/sites/wordpress.tv/categories
Added it either way. Deployed now.
Note: See
TracTickets for help on using
tickets.
In 9286: