Changeset 9141 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
- Timestamp:
- 09/15/2019 05:53:39 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
r9140 r9141 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 );223 $result['author_block_count'] = get_post_meta( $post_id, 'author_block_count', true ) ?: intval( count( $result['blocks'] ) > 0 ); 224 224 // Fun fact: ratings are stored as 1-5 in postmeta, but returned as percentages by the API 225 $result['author_block_rating'] = get_post_meta( $post_id, 'author_block_rating' ) ? 20 * get_post_meta( $post_id, 'author_block_rating') : $result['rating'];225 $result['author_block_rating'] = get_post_meta( $post_id, 'author_block_rating', true ) ? 20 * get_post_meta( $post_id, 'author_block_rating', true ) : $result['rating']; 226 226 227 227 // That's all folks!
Note: See TracChangeset
for help on using the changeset viewer.