I'm using Contact Form 7 in my wordpress installation. I need to somehow pass a hidden field with the current page url in the contact form hidden field. I tried their custom function and tried the short code, no luck.
wpcf7_add_shortcode('sourceurl', 'wpcf7_sourceurl_shortcode_handler', true);
function wpcf7_sourceurl_shortcode_handler($tag) {
if (!is_array($tag)) return '';
$name = $tag['name'];
if (empty($name)) return '';
$html = '<input type="hidden" name="' . $name . '" value="http://' . $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"] . '" />';
return $html;
}
In the form edition I tried [sourceurl thesource]