Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Conversation

@danielbachhuber
Copy link
Member

Also stubs get_collection_params() abstraction for Posts controller to
make it possible for attachments controller to add ?parent=<id> support

Fixes #1767

Also stubs `get_collection_params()` abstraction for Posts controller to
make it possible for attachments controller to add `?parent=<id>` support
@danielbachhuber danielbachhuber added this to the 2.0 Beta 8 milestone Nov 30, 2015
@danielbachhuber
Copy link
Member Author

@WP-API/amigos #reviewmerge

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing that's a little dodgy is that any controller extending this controller could use parent in the request, because we pass all arguments present in the request.

joehoyle added a commit that referenced this pull request Nov 30, 2015
Add `?parent=<id>` support for attachments; update Post `_link`
@joehoyle joehoyle merged commit a524d40 into develop Nov 30, 2015
@joehoyle joehoyle deleted the 1767-parent-attachment branch November 30, 2015 17:40
@ioanlucut
Copy link

Hi! I am using version 2 Beta 10. Can you confirm that this functionality still works ? In my case, it really doesn't work. I am getting empty JSON back when I specify the parent request parameter. Thanks. (Wp v4.4.1)

@danielbachhuber
Copy link
Member Author

Can you confirm that this functionality still works ?

Yes, it does.

In my case, it really doesn't work. I am getting empty JSON back when I specify the parent request parameter.

Please open a new issue for support requests, and we'll help you debug the issue.

@ioanlucut
Copy link

Hi, thanks for your answer! Actually I found out why it doesn't work. It's because a media file can be attached only to one post, therefore by simply adding a new media to a post without checking if it's already attached to another one, doesn't mean it is associated with that specific post.

I find this really awkward, why can't a media item belong to more than one posts ? Anyways, I know this is a Wordpress issue.

Thanks a lot for your answer.

@danielbachhuber
Copy link
Member Author

I find this really awkward, why can't a media item belong to more than one posts ? Anyways, I know this is a Wordpress issue.

Right — we still need to sort that out #1987

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants