I'm trying to write a function that will use a string (which will be a url once working) sent from a shortcode, but all it's sending back is the default value in the function.
My shortcode is
[youtube-thumb-url videoUrl="test"]
My function is below:
add_shortcode('youtube-thumb-url', 'get_youtube_thumb_url_func');
function get_youtube_thumb_url_func($atts)
{
extract(shortcode_atts(array(
'videoUrl' => 'urlhere',
), $atts));
return $videoUrl;
}
Instead of returning "test", it's returning "urlhere". If 'urlhere' is left empty, it returns nothing.