Changeset 6404 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
- Timestamp:
- 01/19/2018 11:27:25 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-template.php
r6287 r6404 372 372 373 373 case '128x128': 374 $icon = self::get_asset_url( $plugin, $info );374 $icon_1x = self::get_asset_url( $plugin, $info ); 375 375 break; 376 376 377 377 /* false = the resolution of the icon, this is NOT disabled */ 378 378 case false && 'icon.svg' == $file: 379 $ svg = self::get_asset_url( $plugin, $info );380 break; 381 } 382 } 383 384 // Fallback to SVGif it exists.385 if ( ! $icon && $ svg) {386 $icon = $ svg;379 $icon = $svg = self::get_asset_url( $plugin, $info ); 380 break; 381 } 382 } 383 384 // Fallback to 1x if it exists. 385 if ( ! $icon && $icon_1x ) { 386 $icon = $icon_1x; 387 387 } 388 388 … … 412 412 $id = "plugin-icon-{$plugin->post_name}"; 413 413 $html = "<style type='text/css'>"; 414 $html .= "#{$id} { background-image: url('{$icon}'); } .plugin-icon { background-size: cover; height: 128px; width: 128px; }";415 if ( ! empty( $icon_2x ) && ! $generated ) {414 $html .= "#{$id} { background-image: url('{$icon}'); }"; 415 if ( ! empty( $icon_2x ) && ! $generated && ! $svg ) { 416 416 $html .= "@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi) { #{$id} { background-image: url('{$icon_2x}'); } }"; 417 417 }
Note: See TracChangeset
for help on using the changeset viewer.