I'm trying to add an image with this shortcode:
add_shortcode('img_portfolio', 'add_img_portfolio');
function add_img_portfolio($atts){
shortcode_atts(array(
'url' => 'https://s3.amazonaws.com/popco/images/services/starter-page/img-placeholder.jpg',
'height' => 'auto'
), $atts);
extract($atts);
return '<img class="img-fluid d-block mx-auto" src="'.$url.'" alt="" width=100% height="'.$height.'">';
}
And getting this error:
Warning: extract() expects parameter 1 to be array, string given
Knowing that this same function pattern works in another shortcode i've made.
Thanks
extract
for security/readability/usability reasons