Title: Short Code within Short code
Last modified: September 1, 2016

---

# Short Code within Short code

 *  Resolved [pdo2641](https://wordpress.org/support/users/pdo2641/)
 * (@pdo2641)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/short-code-within-short-code/)
 * First, great plugin. Suggest you show two variables in your help so one can know
   the variables in the shortcode are seperated by a space, not a commoa.
 * Second, I appeal to your genius.
    I use formidablePro forms plugin.
 * I coded a Post Snippet, encryptme.
 *     ```
       $qstring ="{fn}|{ln}|{em}|{pid}|{oid}|{rid}";
   
         //echo $qstring."<br/>";
          $password="mysecretpassword";
          $salt = substr(md5(mt_rand(), true), 8);
   
           $key = md5($password . $salt, true);
           $iv  = md5($key . $password . $salt, true);
   
           $ct = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $qstring, MCRYPT_MODE_CBC, $iv);
   
           echo urlencode(base64_encode('Salted__' . $salt . $ct));
       ```
   
 * The short code:
    `[encryptme fn="John' ln="Doe" em="jd2544@gmail.com" pid="PWA"
   oid="87" rid="WSC1034"]`
 * If I place the short code in a formidable field, it returns the encrypted string
   just fine…wonderful.
    However, if I use a formidable short code, i.e., a shortcode
   representing the contents of another field on the form, [Field#] in place of 
   the literals for the variables in the Post Snippets shortcode, it get lost in
   its underwear. I’ve used [85], ‘[85]’, “[85]” flavors, where 85 is field number.
   No go. Short code in a short code. Can you do a ‘do_shortcode’?
 * [https://wordpress.org/plugins/post-snippets/](https://wordpress.org/plugins/post-snippets/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [pdo2641](https://wordpress.org/support/users/pdo2641/)
 * (@pdo2641)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/short-code-within-short-code/#post-7518448)
 * Update: Shortcodes can’t be passed as variables with this plugin. I suspect another
   update to fix something caused a problem with short codes being passed. There
   is some earlier comments to indicate it once worked.
 * If I have a Post Snippet short code [encryptme mycontent = “Super”]. The snippet
   with PHP and Shortcode checked is thus
    Name: encryptme, Variables: mycontent.
   Code: $qstring = {mycontent}; echo $qstring; It will return: Super.
 * If,however I use [encryptme mycontent = “[frm-field-value field_id=67]”] and 
   the shortcode [frm-field-value field_id=67] would return Super, it doesn’t work.
   I’ve encapsulate with single quotes, single quote and doublequoted, added do_shortcode
   to the PHP. Many of the returns were bizarre, but know were correct.
    If anyone
   can see an error in my code, please comment. So, it appears if you’re using the
   plugin for passing variables (not literals) as shortcodes to PHP, it doesn’t 
   work (anymore). Too bad.
 * Thanks.

Viewing 1 replies (of 1 total)

The topic ‘Short Code within Short code’ is closed to new replies.

 * ![](https://ps.w.org/post-snippets/assets/icon-128x128.gif?rev=2545587)
 * [Post Snippets - Custom WordPress Code Snippets Customizer](https://wordpress.org/plugins/post-snippets/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-snippets/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-snippets/)
 * [Active Topics](https://wordpress.org/support/plugin/post-snippets/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-snippets/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-snippets/reviews/)

## Tags

 * [shortcode in shortcode](https://wordpress.org/support/topic-tag/shortcode-in-shortcode/)

 * 1 reply
 * 1 participant
 * Last reply from: [pdo2641](https://wordpress.org/support/users/pdo2641/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/short-code-within-short-code/#post-7518448)
 * Status: resolved