Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#20001 closed feature request (worksforme)

Update plugins_api to return short_description when querying 'plugin_information'

Reported by: DJPaul Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: WordPress.org site Keywords:
Focuses: Cc:


When querying plugins_api() with 'plugin_information', can the short_description be added to the results? It's currently exposed on the results from 'query_plugins'.

Change History (3)

comment:1 @nacin4 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Try this: plugins_api( 'plugin_information', array( 'slug' => 'jetpack', 'fields' => array( 'short_description' => true ) ) );

Allowed fields and their global defaults:

'short_description' => true,
'description' => false,
'sections' => true,
'tested' => true,
'requires' => true,
'rating' => true,
'downloaded' => true,
'downloadlink' => true,
'last_updated' => true,
'added' => true,
'tags' => true,
'compatibility' => true,
'homepage' => true,
'versions' => false,

For query_plugins, these defaults take precedence:

'description' => true,
'sections' => false,
'downloaded' => false,
'downloadlink' => false,
'last_updated' => false,
'added' => false,
'tags' => false,

For plugin_information, additionally, 'short_description' => false.

To turn on/off any field that is/is not included by default, simply pass 'fields' => array( 'some_field' => true/false ) ).

Version 0, edited 4 years ago by nacin (next)

comment:2 @nacin4 years ago

  • Milestone Awaiting Review deleted

comment:3 @DJPaul4 years ago

Thanks, that did it. Wasn't aware of those parameters.

Note: See TracTickets for help on using tickets.