Making WordPress.org


Ignore:
Timestamp:
08/28/2019 08:42:53 AM (6 years ago)
Author:
tellyworth
Message:

Plugin dir: return additional metadata in block search results.

Adds author_block_rating and author_block_count.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/class-plugins-info-api-request.php

    r9055 r9118  
    103103    );
    104104
     105    // Default fields for block queries
     106    static $query_plugins_fields_defaults_block = array(
     107        'blocks'               => true,
     108        'block_assets'         => true,
     109        'author_block_count'   => true,
     110        'author_block_rating'  => true,
     111    );
     112
    105113    public function __construct( $args ) {
    106114        $args = (object) $args;
     
    160168        // If it's a block search, include blocks in the response by default
    161169        if ( ! empty( $this->args->block ) ) {
    162             $fields['blocks']       = true;
    163             $fields['block_assets'] = true;
     170            $fields = array_merge( $fields, self::$query_plugins_fields_defaults_block );
    164171        }
    165172
Note: See TracChangeset for help on using the changeset viewer.