Changeset 10211 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
- Timestamp:
- 08/27/2020 03:05:20 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r9862 r10211 73 73 74 74 $num_ratings = array_sum( $ratings ); 75 $images = []; 75 76 $banners = self::get_plugin_banner( $plugin ); 76 77 $icons = self::get_plugin_icon( $plugin ); 77 78 78 // Ignore the icons if we're relying upon the geopattern default. 79 if ( $icons['generated'] ) { 80 $icons = [ 'svg' => false, 'icon_2x' => false, 'icon' => false ]; 79 // First non-generated icon. 80 if ( $icons && ! $icons['generated'] ) { 81 foreach ( [ 'svg', 'icon_2x', 'icon' ] as $field ) { 82 if ( !empty( $icons[ $field ] ) ) { 83 $images[] = $icons[ $field ]; 84 break; 85 } 86 } 87 } 88 // Largest appropriate banner. rtl fields returned when is_rtl(). 89 if ( $banners ) { 90 foreach ( [ 'banner_2x_rtl', 'banner_rtl', 'banner_2x', 'banner' ] as $field ) { 91 if ( !empty( $banners[ $field ] ) ) { 92 $images[] = $banners[ $field ]; 93 break; 94 } 95 } 81 96 } 82 97 … … 112 127 "userInteractionCount" => self::get_downloads_count( $plugin ), 113 128 ], 114 "image" => array_values( array_filter( [ 115 // RTL 2x Banner or RTL 1x Banner, otherwise 2x Banner or 1x Banner 116 ( $banners['banner_2x_rtl'] ?: $banners['banner_rtl'] ) ?: ( $banners['banner_2x'] ?: $banners['banner'] ), 117 // Plugin Icon, SVG is priority, otherwise 2x or 1x. 118 ( $icons['svg'] ?: $icons['icon_2x'] ) ?: $icons['icon'], 119 ] ) ), 129 "image" => $images, 120 130 "offers" => [ 121 131 "@type" => "Offer",
Note: See TracChangeset
for help on using the changeset viewer.