Title: Further support for [insert_php] shortcodes
Last modified: June 13, 2018

---

# Further support for [insert_php] shortcodes

 *  [eckartschulz](https://wordpress.org/support/users/eckartschulz/)
 * (@eckartschulz)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/)
 * Please go on supporting the [insert_php] shortcodes, because the new solution
   does not work with several shortcodes of other plugins, but the old one does.
   So in these special cases I have to use the old [insert_php] shortcodes.

Viewing 10 replies - 1 through 10 (of 10 total)

 *  Plugin Author [webcraftic](https://wordpress.org/support/users/webcraftic/)
 * (@webcraftic)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10394795)
 * Hi,
 * Can you show a sample code where you have difficulty? Maybe I can find a solution
   for this situation.
 * Best regards, Alex
 *  [bjrnet21](https://wordpress.org/support/users/bjrnet21/)
 * (@bjrnet21)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10399181)
 * Yes, I am having the same problem with incompatibility with other shortcodes 
   that I use alongside [insert_php].
 * For example:
 * [insert_php] if ($Month == “” AND $Year == “”) {echo “[tdih_tab day= $Day]”; }
   else if …..
 * The [tdib_tab] shortcode won’t run in a php snippet. It just comes across as 
   text.
 * I’ve tried for hours trying to find a workaround, but so far no luck.
 * PLEASE CONTINUE SUPPORTING the [insert_php] shortcode.
 * Thanks for a great plug-in.
 *  Plugin Author [webcraftic](https://wordpress.org/support/users/webcraftic/)
 * (@webcraftic)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10399403)
 * Hi guys,
 * I’ll show you a new way how to do this with snippets.
    Use the do_shortcode function
   to call the shortcode of someone else’s plugin in the snippet.
 * Example:
 *     ```
       if ( is_user_logged_in() ) { 
         echo do_shortcode('[wbcr_php_snippet id="297"]');  
       } else {
         echo "You must log in.";
       }
       ```
   
 *  [bjrnet21](https://wordpress.org/support/users/bjrnet21/)
 * (@bjrnet21)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10400274)
 * Is it possible to share the value of a variable created in one PHP snippet to
   another PHP snippet on the same page?
 * Appreciate the do_shortcode suggestion. That solves one problem I was having.
   But I need to be able to share some variables.
 *  Plugin Author [webcraftic](https://wordpress.org/support/users/webcraftic/)
 * (@webcraftic)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10400306)
 * [@bjrnet21](https://wordpress.org/support/users/bjrnet21/)
    Show your code, I’ll
   write, how it can be done with the help of snippets. While I do not quite understand
   what you mean.
 *  [bjrnet21](https://wordpress.org/support/users/bjrnet21/)
 * (@bjrnet21)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10400452)
 * SNIPPET #1
    $Month = “”; $Day = “”; $Year = “”; $Month = $_GET[“Month”]; $Day
   = $_GET[“Day”]; $Year = $_GET[“Year”];
 * SNIPPET #2
    echo “<input id=’myMonth’ style=’width: 110px;’ max=’12’ min=’1′ 
   name=’Month’ type=’number’ value='”;echo $Month;echo”‘ />”;
 * SNIPPET #3 AND #4 AND SAME WITH DAY AND YEAR
 * SNIPPET #5
    echo do_shortcode(‘[tdih month= $Month day= $Day year= $Year]’);
 * It appears that $Month $Day and $Year are not coming across. How do I pass variables
   into do_shortcode()?
 *  [bjrnet21](https://wordpress.org/support/users/bjrnet21/)
 * (@bjrnet21)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10401108)
 * I think I figured it out. I have to build the shortcode “string” and then pass
   it to the do_shortcode() function.
 * Example:
    $tdih = “[tdih_tab month= ” . $Month . ” day= ” . $Day . ” year= ” .
   $Year . “]”; echo do_shortcode($tdih);
 *  [bjrnet21](https://wordpress.org/support/users/bjrnet21/)
 * (@bjrnet21)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10401886)
 * Success! I was able to move all my instances of the old [insert_php] code over
   to the [wbcr_php_snippet id=”xxx”] format.
 * [https://www.blackjackreview.com/wp/historical-events/tool/](https://www.blackjackreview.com/wp/historical-events/tool/)
 * Thank you for your support!
 *  Plugin Author [webcraftic](https://wordpress.org/support/users/webcraftic/)
 * (@webcraftic)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10402092)
 * [@bjrnet21](https://wordpress.org/support/users/bjrnet21/)
 * I am very glad to help you, if you have difficulties write, let me know. I think
   there are no problems that can not be solved. 🙂
 * Best regards, Alex
 *  Thread Starter [eckartschulz](https://wordpress.org/support/users/eckartschulz/)
 * (@eckartschulz)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10402591)
 * Great! With the use of do_shortcode everything works fine! Thanks for your tip!
    -  This reply was modified 7 years, 11 months ago by [eckartschulz](https://wordpress.org/support/users/eckartschulz/).

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Further support for [insert_php] shortcodes’ is closed to new replies.

 * ![](https://ps.w.org/insert-php/assets/icon-256x256.gif?rev=3523853)
 * [Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts](https://wordpress.org/plugins/insert-php/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/insert-php/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/insert-php/)
 * [Active Topics](https://wordpress.org/support/plugin/insert-php/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/insert-php/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/insert-php/reviews/)

 * 10 replies
 * 3 participants
 * Last reply from: [eckartschulz](https://wordpress.org/support/users/eckartschulz/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/further-support-for-insert_php-shortcodes/#post-10402591)
 * Status: not a support question