This repository has been archived by the owner. It is now read-only.

Permit logged-in users to query for media #1973

Merged
merged 2 commits into from Jan 8, 2016

Conversation

Projects
None yet
2 participants
@danielbachhuber
Member

danielbachhuber commented Jan 8, 2016

Fixes #1959

danielbachhuber added some commits Jan 8, 2016

Default to `inherit` when querying attachments
It's the expected status for attachments

@danielbachhuber danielbachhuber added this to the 2.0 Beta 10 milestone Jan 8, 2016

@danielbachhuber

This comment has been minimized.

Show comment
Hide comment
@danielbachhuber
Member

danielbachhuber commented Jan 8, 2016

@WP-API/amigos #reviewmerge

@@ -1604,7 +1604,7 @@ public function get_collection_params() {
),
);
$params['status'] = array(
'default' => 'publish',
'default' => 'attachment' === $this->post_type ? 'inherit' : 'publish',

This comment has been minimized.

@joehoyle

joehoyle Jan 8, 2016

Contributor

If I do a request logged out for /media and there's a bunch of posts with post_status=inherit which are attached to private posts, what does the response look like? Does it just remove the attachments I can't view (thus I get 6 results rather than the default 10) or do I get an error, or somethign else?

@joehoyle

joehoyle Jan 8, 2016

Contributor

If I do a request logged out for /media and there's a bunch of posts with post_status=inherit which are attached to private posts, what does the response look like? Does it just remove the attachments I can't view (thus I get 6 results rather than the default 10) or do I get an error, or somethign else?

This comment has been minimized.

@danielbachhuber

danielbachhuber Jan 8, 2016

Member

Does it just remove the attachments I can't view (thus I get 6 results rather than the default 10)

Yes, which is a consistent pattern we have throughout the controllers.

@danielbachhuber

danielbachhuber Jan 8, 2016

Member

Does it just remove the attachments I can't view (thus I get 6 results rather than the default 10)

Yes, which is a consistent pattern we have throughout the controllers.

This comment has been minimized.

@joehoyle

joehoyle Jan 8, 2016

Contributor

👍

@joehoyle

joehoyle Jan 8, 2016

Contributor

👍

joehoyle added a commit that referenced this pull request Jan 8, 2016

Merge pull request #1973 from WP-API/1959-fix-query-media
Permit logged-in users to query for media

@joehoyle joehoyle merged commit 7573f8a into develop Jan 8, 2016

3 checks passed

Scrutinizer 60 new issues, 29 updated code elements
Details
codecov/project 93.37% (target 80.00%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@joehoyle joehoyle deleted the 1959-fix-query-media branch Jan 8, 2016

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