Skip to content
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

Request for additional fields in plugin search --fields= #2568

Closed
hinoue-work opened this issue Mar 17, 2016 · 4 comments
Closed

Request for additional fields in plugin search --fields= #2568

hinoue-work opened this issue Mar 17, 2016 · 4 comments

Comments

@hinoue-work
Copy link

I would like to display fields that aren't available in the plugin search API. This page,
https://developer.wordpress.org/reference/functions/plugins_api/, has a list of fields that are available. Specifically, I'd like to get at the downloaded or active_installs fields.

Can someone explain why these fields are not available or give some guidance on how I might add support for them?

@danielbachhuber
Copy link
Member

Can someone explain why these fields are not available or give some guidance on how I might add support for them?

I'm not sure the fields param actually works in API requests. Might be a bug introduced in the WordPress.org API.

@danielbachhuber
Copy link
Member

HTTP POST with the default request args returns all fields for me.

array (
  'timeout' => 15,
  'body' =>
  array (
    'action' => 'query_plugins',
    'request' => 'O:8:"stdClass":4:{s:8:"per_page";i:10;s:6:"search";s:3:"foo";s:6:"fields";a:3:{i:0;s:4:"name";i:1;s:4:"slug";i:2;s:6:"rating";}s:6:"locale";s:5:"en_US";}',
  ),
)

@danielbachhuber
Copy link
Member

I've created a Meta Trac ticket: https://meta.trac.wordpress.org/ticket/1637

@hinoue-work
Copy link
Author

Wow! This is great. Thanks.

I just tried it out - It works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants