Title: how to pass variable to function
Last modified: August 31, 2016

---

# how to pass variable to function

 *  Resolved [guenstig-kochen.at](https://wordpress.org/support/users/guenstig-kochenat/)
 * (@guenstig-kochenat)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/how-to-pass-variable-to-function/)
 * hi,
 * i have to call something like this
 * function(‘$user_id’)
 * doesn’t work.
 * i tried
 * function(‘<?php echo $user_id; ?>’)
    function(‘\”<?php echo $user_id; ?>\”‘)
 * and so on. nothing happened.
 * if i will give manually, for an example, ‘1’ … it works well.
 * any hints to resolve that problem?
 * regards form austria
 * [https://wordpress.org/plugins/jin-menu/](https://wordpress.org/plugins/jin-menu/)

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

 *  [lilpantherpaw](https://wordpress.org/support/users/lilpantherpaw/)
 * (@lilpantherpaw)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/how-to-pass-variable-to-function/#post-7112999)
 * I have “Before and After Gallery” plugin installed.
    I changed my menu item “
   Gallery” to a custom link. I enabled “No Conflict” on Appearance>JinMenus I added
   my code from my Gallery plugin ‘onclick=”triggerBeforeAfterGallery(123)”‘
 * Nothing happens when I click on the Gallery link in my navigation menu.
 *  Plugin Author [Rohit Kumar](https://wordpress.org/support/users/aniketan/)
 * (@aniketan)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/how-to-pass-variable-to-function/#post-7113020)
 * hello guenstig-kochen.at
 * wordpress trim any tags before they sent to the database
    so your php variable
   will not work , only static value you can pass i will look further to employ 
   this
 * thanks
 *  Plugin Author [Rohit Kumar](https://wordpress.org/support/users/aniketan/)
 * (@aniketan)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/how-to-pass-variable-to-function/#post-7113021)
 * [@lilpantherpaw](https://wordpress.org/support/users/lilpantherpaw/) your gallery
   will inject gallery codes only if there gallery menu links is in there .
 * triggerBeforeAfterGallery will not work because this function is not present 
   there so custom menu wont help you that

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

The topic ‘how to pass variable to function’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/jin-menu.svg)
 * [JinMenu](https://wordpress.org/plugins/jin-menu/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/jin-menu/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/jin-menu/)
 * [Active Topics](https://wordpress.org/support/plugin/jin-menu/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/jin-menu/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/jin-menu/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Rohit Kumar](https://wordpress.org/support/users/aniketan/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/how-to-pass-variable-to-function/#post-7113021)
 * Status: resolved