Changeset 9473
- Timestamp:
- 02/06/2020 12:48:01 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r9468 r9473 67 67 $ratings = get_post_meta( $plugin->ID, 'ratings', true ) ?: []; 68 68 $num_ratings = array_sum( $ratings ); 69 $banners = self::get_plugin_banner( $plugin ); 70 $icons = self::get_plugin_icon( $plugin ); 71 72 // Ignore the icons if we're relying upon the geopattern default. 73 if ( $icons['generated'] ) { 74 $icons = []; 75 } 69 76 70 77 $schema = []; … … 73 80 $software_application = [ 74 81 "@context" => "http://schema.org", 75 "@type" => "SoftwareApplication", 76 "applicationCategory" => "http://schema.org/OtherApplication", 82 "@type" => [ 83 "SoftwareApplication", 84 "Product" 85 ], 86 "applicationCategory" => "Plugin", 87 "operatingSystem" => "WordPress", 77 88 "name" => get_the_title( $plugin ), 78 89 "url" => get_permalink( $plugin ), … … 95 106 "userInteractionCount" => self::get_downloads_count( $plugin ), 96 107 ], 108 "image" => array_values( array_filter( [ 109 // RTL 2x Banner or RTL 1x Banner, otherwise 2x Banner or 1x Banner 110 ( $banners['banner_2x_rtl'] ?: $banners['banner_rtl'] ) ?: ( $banners['banner_2x'] ?: $banners['banner'] ), 111 // Plugin Icon, SVG is priority, otherwise 2x or 1x. 112 ( $icons['svg'] ?: $icons['icon_2x'] ) ?: $icons['icon'], 113 ] ) ), 97 114 "offers" => [ 98 115 "@type" => "Offer", 116 "url" => get_permalink( $plugin ), 99 117 "price" => "0.00", 100 118 "priceCurrency" => "USD", … … 107 125 ]; 108 126 127 // Remove the aggregateRating node if there's no reviews. 109 128 if ( ! $software_application['aggregateRating']['ratingCount'] ) { 110 129 unset( $software_application['aggregateRating'] ); 130 } 131 132 // Remove the images property if no images exist. 133 if ( ! $software_application['image'] ) { 134 unset( $software_application['image'] ); 111 135 } 112 136
Note: See TracChangeset
for help on using the changeset viewer.