Changeset 9118
- Timestamp:
- 08/28/2019 08:42:53 AM (6 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
r9055 r9118 221 221 $result['blocks'] = get_post_meta( $post_id, 'all_blocks', true ) ?: []; 222 222 $result['block_assets'] = get_post_meta( $post_id, 'block_files', true ) ?: []; 223 $result['author_block_count'] = get_post_meta( $post_id, 'author_block_count' ) ?: intval( count( $result['blocks'] ) > 0 ); 224 $result['author_block_rating'] = get_post_meta( $post_id, 'author_block_rating' ) ?: $result['rating']; 223 225 224 226 // That's all folks! -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/class-plugins-info-api-request.php
r9055 r9118 103 103 ); 104 104 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 105 113 public function __construct( $args ) { 106 114 $args = (object) $args; … … 160 168 // If it's a block search, include blocks in the response by default 161 169 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 ); 164 171 } 165 172
Note: See TracChangeset
for help on using the changeset viewer.