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/api/routes/class-plugin.php

    r9055 r9118  
    221221        $result['blocks'] = get_post_meta( $post_id, 'all_blocks', true ) ?: [];
    222222        $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'];
    223225
    224226        // That's all folks!
Note: See TracChangeset for help on using the changeset viewer.