Changeset 9140 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
- Timestamp:
- 09/15/2019 04:47:58 PM (6 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
r9127 r9140 222 222 $result['block_assets'] = get_post_meta( $post_id, 'block_files', true ) ?: []; 223 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']; 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 226 226 227 // That's all folks!
Note: See TracChangeset
for help on using the changeset viewer.