title: Wordpress: Set input value as shortcode
body: <p>I'm using a plugin called USP Pro on Wordpress. I wanted to use the following code to post values from a previous form, but soon discovered that I cannot use PHP in the back-end editor on Wordpress for my input value:</p>
  
  <pre><code>&lt;input name="usp-title" type="text" value="&lt;?php echo $_POST[titles]; ?&gt;" /&gt;
  </code></pre>
  
  <p>As PHP is not supported in the editor, I created a shortcode instead called [input] which is for the above PHP snippet and set it to the value as seen below. </p>
  
  <pre><code>&lt;input name="usp-title" type="text" value="[input]" /&gt;
  </code></pre>
  
  <p>In the front-end, however, the shortcode just appears in the input text box as [input]. Before creating the shortcode, I have tried using plugins to enable PHP to execute in the text editor but haven't been successful with those either. Also, I'd prefer to avoid creating a template and putting the code in (although it would solve my php issue) as it would mean I'd have to modify some of the plugin's code regarding php sessions, and I don't have the necessary skills as im new to php.  If anyone could help me come up with a solution to setting the input value to the PHP snippet I'd be very appreciative. </p>
  
  <p>Here is what I put in to my functions.php for the PHP snippet as well. </p>
  
  <pre><code>function input_func( $atts ) {
  extract( shortcode_atts( array(
      'type' =&gt; 'text',
      'name' =&gt; '',
  ), $atts ) );
  
  return '&lt;input name="' . $name . '" id="' . $name . '" value="' .        
  (isset($_POST['titles']) &amp;&amp; $_POST['titles'] ? $_POST['titles'] : '') . '"        
  type="' . $type . '" /&gt;';
  }
  add_shortcode( 'input', 'input_func' ); 
  </code></pre>
  
  <p>Thank you. </p>