WordPress.org

Making WordPress.org

Changeset 9141


Ignore:
Timestamp:
09/15/2019 05:53:39 PM (15 months ago)
Author:
tellyworth
Message:

Plugin directory: fix uncaught error.

Make sure we're doing math on scalars.

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  
    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 );
     223        $result['author_block_count'] = get_post_meta( $post_id, 'author_block_count', true ) ?: intval( count( $result['blocks'] ) > 0 );
    224224        // 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'];
    226226
    227227        // That's all folks!
Note: See TracChangeset for help on using the changeset viewer.