-
Notifications
You must be signed in to change notification settings - Fork 793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Related Posts: add list of post IDs to WP REST API Post responses #3424
Labels
[Feature] Related Posts
[Type] Enhancement
Changes to an existing feature — removing, adding, or changing parts of it
Milestone
Comments
jeherve
added
[Type] Enhancement
Changes to an existing feature — removing, adding, or changing parts of it
[Feature] Related Posts
labels
Feb 18, 2016
jeherve
added a commit
that referenced
this issue
Feb 18, 2016
Fixes #3424 To test: 1. Install and activate the WP REST API plugin (v2) 2. Make sure Related Posts are enabled in Jetpack. 3. Visit `http://yoursite.com/wp-json/wp/v2/posts` 4. Look for the new `jetpack-related-posts` field
jeherve
changed the title
Related Posts: add list of post IDs to WP REST API Post responses
Related Posts: add list of post IDs to WP REST API Post responses
Feb 18, 2016
rcoll
pushed a commit
that referenced
this issue
Aug 29, 2016
Fixes #3424 To test: 1. Install and activate the WP REST API plugin (v2) 2. Make sure Related Posts are enabled in Jetpack. 3. Visit `http://yoursite.com/wp-json/wp/v2/posts` 4. Look for the new `jetpack-related-posts` field
zinigor
pushed a commit
that referenced
this issue
Oct 21, 2016
* Related Posts: add posts to the WP REST API Post Response. Fixes #3424 To test: 1. Install and activate the WP REST API plugin (v2) 2. Make sure Related Posts are enabled in Jetpack. 3. Visit `http://yoursite.com/wp-json/wp/v2/posts` 4. Look for the new `jetpack-related-posts` field * Related Posts: updated version numbers in docblocks. * Related Posts: only register the field when the function exists. @see #3425 (comment)
Hey guys, don't know if this is related, but seems to be related custom post types are not added to the REST API when related default post types are.
|
@ziyafenn Sorry that you are running into issues. Could you contact us via this contact form and give us more details and examples there, so we can help you get this fixed? Thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Related Posts
[Type] Enhancement
Changes to an existing feature — removing, adding, or changing parts of it
The WordPress.com REST API includes the
/sites/$site/posts/$post/related
endpoint, that we use to get related post IDs for a specific post. We then use the_jetpack_related_posts_cache
post meta to store the IDs of each Related Post locally.It's useful, but that data can't be accessed by the core WP REST API.
It would be nice if we could register a new field in the API to expose these post IDs, maybe in a
jetpack-related-posts
array underwp-json/wp/v2/posts/$post
.This would make it easier for folks developing themes using the WP REST API, and wanting to use Jetpack Related Posts without having to do remote queries to the WordPress.com REST API and handling caching themselves.
The text was updated successfully, but these errors were encountered: