commons
1 month ago
dashboard
1 month ago
dialogs
1 month ago
email-lists
9 months ago
embedded
3 years ago
global
5 months ago
integrations
1 month ago
integrations-page
5 months ago
popup
3 years ago
settings
1 month ago
slidein
3 years ago
sshare
9 months ago
dashboard.php
1 month ago
entries.php
2 years ago
image-markup.php
3 years ago
integrations.php
1 month ago
settings.php
1 month ago
tutorials.php
3 years ago
upsell.php
2 years ago
widget-analytics.php
3 years ago
image-markup.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Common image markup. |
| 4 | * |
| 5 | * @package Hustle |
| 6 | */ |
| 7 | |
| 8 | // If image is not set return empty string. |
| 9 | if ( empty( $path ) ) { |
| 10 | return ''; |
| 11 | } |
| 12 | ?> |
| 13 | <img src="<?php echo esc_url( $path ); ?>" |
| 14 | title="<?php /* translators: Plugin name */ echo esc_attr( sprintf( __( '%s image', 'hustle' ), Opt_In_Utils::get_plugin_name() ) ); ?>" |
| 15 | alt="<?php /* translators: Plugin name */ echo esc_attr( sprintf( __( '%1$s image commonly %1$s-Man doing something fun', 'hustle' ), Opt_In_Utils::get_plugin_name() ) ); ?>" |
| 16 | |
| 17 | <?php if ( ! empty( $retina_path ) ) { ?> |
| 18 | srcset="<?php echo esc_url( $path ) . ' 1x, ' . esc_url( $retina_path ) . ' 2x'; ?>" |
| 19 | <?php } ?> |
| 20 | |
| 21 | <?php if ( ! empty( $class ) ) { ?> |
| 22 | class="<?php echo esc_attr( $class ); ?>" |
| 23 | <?php } ?> |
| 24 | |
| 25 | <?php |
| 26 | // Add styles to image. |
| 27 | if ( ! empty( $width ) || ! empty( $height ) ) { |
| 28 | echo ' style="'; |
| 29 | |
| 30 | if ( ! empty( $width ) ) { |
| 31 | echo 'max-width: ' . esc_attr( 'auto' === $width ? 'auto' : intval( $width ) ) . 'px;'; |
| 32 | } |
| 33 | |
| 34 | if ( ! empty( $height ) ) { |
| 35 | echo 'max-height: ' . intval( $height ) . 'px;'; |
| 36 | } |
| 37 | |
| 38 | echo '"'; |
| 39 | } |
| 40 | ?> |
| 41 | |
| 42 | aria-hidden="true" /> |
| 43 |