Last active
July 12, 2019 21:02
-
-
Save joejwright/6b170fac6ff5372dfb44c872ec5149fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fix_single_image( $atts ){ | |
$atts = shortcode_atts( array( | |
'class' => 'vce-single-image', | |
'src' => '', | |
'data-width' => '', | |
'data-height' => '', | |
'data-img-src' => '', | |
'alt' => '', | |
'title' => '' | |
), $atts ); | |
$buffer = "<img"; | |
foreach ($atts as $key => $value) { | |
$buffer = $buffer." $key='$value'"; | |
} | |
$buffer = $buffer." />"; | |
return $buffer; | |
} | |
add_shortcode( 'vcvSingleImage', 'fix_single_image' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment