Making WordPress.org


Ignore:
Timestamp:
07/18/2019 08:28:52 AM (7 years ago)
Author:
tellyworth
Message:

Plugin dir: include block metadata in results.

This returns blocks and block_assets fields in search results for block queries.

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

    r9051 r9055  
    3333                'tested'            => false,
    3434                'stable_tag'        => false,
     35                'blocks'            => false,
     36                'block_assets'      => false,
    3537        );
    3638
    … …  
    5254                'tags'              => true,
    5355                'tested'            => true,
     56                'blocks'            => false,
     57                'block_assets'      => false,
    5458        );
    5559
    … …  
    8387                'tags'              => true,
    8488                'tested'            => true,
     89                'blocks'            => false,
     90                'block_assets'      => false,
    8591        );
    8692
    … …  
    152158                }
    153159
     160                // If it's a block search, include blocks in the response by default
     161                if ( ! empty( $this->args->block ) ) {
     162                        $fields['blocks']       = true;
     163                        $fields['block_assets'] = true;
     164                }
     165
    154166                $fields = array_merge( $fields, $this->requested_fields );
    155167
Note: See TracChangeset for help on using the changeset viewer.