A way to utilize the json-rest-api libraries to generate embedded post json
-
hello,
i was looking for guidance to utilizing the json-rest-api to output post output in the same format that exists now for posts.just to give some context to what i am trying to do, i have a custom post type that stores related posts by title/post_id, so when i call the json rest api by ?type=MY_CUSTOM_POST_TYPE, i get the json output and i created a function/method call to get the related posts by id, much like the class-wp-json-posts does, but when i attached it to the filter for additional json output, the data comes out flat and not in the same format that i get for a single post in the api. could you point me into the direction where i can get the same representation of the data with my method. i’ve tried utilizing the WP_JSON_Posts::get_post() method, but the data isn’t embedding in the node that i defined.
thanks in advance,
~rob
- The topic ‘A way to utilize the json-rest-api libraries to generate embedded post json’ is closed to new replies.