mirror of https://github.com/cncf/cncf.io.git
Fixing cowboy coding
Signed-off-by: James Hunt <10615884+thetwopct@users.noreply.github.com>
This commit is contained in:
parent
e35cc56abb
commit
85f88ff7b7
|
|
@ -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
|
||||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue