block.json
1 year ago
controller.php
1 year ago
empty.php
1 year ago
index.asset.php
4 months ago
index.js
4 months ago
style-index-rtl.css
1 year ago
style-index.css
1 year ago
view.php
1 year ago
controller.php
25 lines
| 1 | <?php |
| 2 | $class = $attributes['sizing'] ? 'contain' === $attributes['sizing'] ? 'sc-is-contained' : 'sc-is-covered' : 'sc-is-covered'; |
| 3 | |
| 4 | $style = ''; |
| 5 | $style .= ! empty( $attributes['aspectRatio'] ) |
| 6 | ? esc_attr( safecss_filter_attr( 'aspect-ratio:' . $attributes['aspectRatio'] ) ) . ';' |
| 7 | : ''; |
| 8 | $style .= ! empty( $attributes['width'] ) |
| 9 | ? esc_attr( safecss_filter_attr( 'width:' . $attributes['width'] ) ) . ';' |
| 10 | : ''; |
| 11 | $style .= ! empty( $attributes['height'] ) |
| 12 | ? esc_attr( safecss_filter_attr( 'height:' . $attributes['height'] ) ) . ';' |
| 13 | : ''; |
| 14 | |
| 15 | $is_link = ( isset( $attributes['isLink'] ) && $attributes['isLink'] ); |
| 16 | $rel = ! empty( $attributes['rel'] ) ? $attributes['rel'] : ''; |
| 17 | |
| 18 | $product_image_html = sc_get_product_featured_image( 'medium_large', [ 'loading' => 'lazy' ] ); |
| 19 | |
| 20 | if ( $product_image_html ) { |
| 21 | return 'file:./view.php'; |
| 22 | } |
| 23 | |
| 24 | return 'file:./empty.php'; |
| 25 |