Skip to content

Commit

Permalink
Fixing cowboy coding
Browse files Browse the repository at this point in the history
Signed-off-by: James Hunt <[email protected]>
  • Loading branch information
thetwopct committed Nov 29, 2024
1 parent e35cc56 commit 85f88ff
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Banner ad Shortcode
*
* Usage example:
* [banner-ad desktop_image_id=120425 mobile_image_id=120426
* external_url="https://training.linuxfoundation.org/cyber-monday-cncf-2024/"
* [banner-ad desktop_image_id=120425 mobile_image_id=120426
* external_url="https://training.linuxfoundation.org/cyber-monday-cncf-2024/"
* alt_txt="CNCF Cyber Monday - Save up to 60%"]
*
* @package WordPress
Expand Down Expand Up @@ -36,16 +36,16 @@ function add_banner_ad_shortcode( $atts ) {
$alt_txt = $atts['alt_txt'];

ob_start();
?>
?>
<div class="has-animation-scale-2" role="banner">
<a href="<?php echo esc_url( $external_url ); ?>" title="<?php echo esc_attr( $alt_txt ) ?>">
<a href="<?php echo esc_url( $external_url ); ?>" title="<?php echo esc_attr( $alt_txt ); ?>">
<picture>
<source media="(max-width: 499px)"
srcset="<?php echo esc_url( wp_get_attachment_image_url( $mobile_image_id, 'full', false ) ); ?>">
<source media="(min-width: 500px)"
srcset="<?php echo esc_url( wp_get_attachment_image_url( $desktop_image_id, 'full', false ) ); ?>">
<img src="<?php echo esc_url( wp_get_attachment_image_url( $desktop_image_id, 'full', false ) ); ?>"
alt="<?php echo esc_attr( $alt_txt ) ?>">
alt="<?php echo esc_attr( $alt_txt ); ?>">
</picture>
</a>
</div>
Expand Down

0 comments on commit 85f88ff

Please sign in to comment.