Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add term_link to prepare_term #15

Merged
merged 3 commits into from

4 participants

@afurculita

Maybe it's a good idea to add the term_link to term data, as we can't get it in any other way. Or there is another way?

@afurculita afurculita Add term_link to prepare_term
Maybe it's a good idea to add the term_link to term data, as we can't get it in any other way. Or there is another way?
fc7372d
@pippinsplugins
Collaborator

I think it's a good idea, though I'll let @rmccue weigh in before merging this.

Before it can be merged, assuming @rmccue approves it, you will need to correct the code formatting to match the rest of the file.

@Japh
Collaborator

Thanks for fixing up the formatting! I think this can be merged in.

@Japh Japh merged commit aae63e8 into from
@rmccue
Owner

:shipit:

@Japh Japh was assigned
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 5, 2013
  1. @afurculita

    Add term_link to prepare_term

    afurculita authored
    Maybe it's a good idea to add the term_link to term data, as we can't get it in any other way. Or there is another way?
  2. @afurculita
  3. @afurculita
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/class-wp-json-taxonomies.php
View
3  lib/class-wp-json-taxonomies.php
@@ -191,6 +191,7 @@ protected function prepare_term( $term, $type, $context = 'view' ) {
'slug' => $term->slug,
'parent' => (int) $term->parent,
'count' => (int) $term->count,
+ 'link' => get_term_link( $term, $term->taxonomy ),
'meta' => array(
'links' => array(
'collection' => json_url( $base_url ),
@@ -208,4 +209,4 @@ protected function prepare_term( $term, $type, $context = 'view' ) {
return apply_filters( 'json_prepare_term', $data, $term );
}
-}
+}
Something went wrong with that request. Please try again.