I'm trying to pass or store a file path string which the CMS user provides in the shortcode, and use this in a function which is then executed when the short code has rendered.
Here are the details:
function wpsdc( $atts ) {
extract( shortcode_atts( array(
'file_path' => '',
'text' => ''
), $atts ) );
$wpsdc_output = wpsdc_short_code($text);
return $wpsdc_output;
}
add_shortcode('wpsdc','wpsdc');
My wpsdc_short_code function returns some basic form html:
<form action='wpsdc-validate-email.php' method='post' id='download_content'>
<input id='emailtext' name='email' type='text'>
<button id='submit-email' type='submit'>Click</button>
</form>
What I am aiming to do is return a string (which I render as an anchor text link) to the file path defined in the initial short code.
[wpsdc file_path='/downloads/some_pdf_file.pdf' text='Click']
How therefore do I get the $file_path variable to my 'wpsdc-validate-email.php' file WITHOUT having the file string visible in the html form mark-up?
Thank you very much in advance.