Changeset 10091 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin.php
- Timestamp:
- 07/23/2020 04:01:51 AM (4 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
r9827 r10091 224 224 // Fun fact: ratings are stored as 1-5 in postmeta, but returned as percentages by the API 225 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 227 // Translations. 228 $result['language_pack'] = []; 229 if ( defined ( 'API_WPORGPATH' ) && file_exists( API_WPORGPATH . '/translations/lib.php' ) ) { 230 require API_WPORGPATH . '/translations/lib.php'; 231 232 $result['language_pack'] = find_all_translations_for_type_and_domain( 233 'plugin', 234 $result['slug'], 235 $result['version'] 236 ); 237 $result['language_pack'] = array_map( function( $item ) use ( $result ) { 238 return [ 239 'type' => 'plugin', 240 'slug' => $result['slug'], 241 'language' => $item->language, 242 'version' => $item->version, 243 'updated' => $item->updated, 244 'package' => $item->package, 245 ]; 246 }, $result['language_pack'] ); 247 } 226 248 227 249 // That's all folks!
Note: See TracChangeset
for help on using the changeset viewer.