Title: Setting Variable value?
Last modified: January 8, 2022

---

# Setting Variable value?

 *  [LesTexas60](https://wordpress.org/support/users/lestexas60/)
 * (@lestexas60)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/setting-variable-value/)
 * I see where I can set the variable value when I create the variable. Is there
   a way to update or change the value by going to a certain page or reading another
   variables value. I have an input field in a form for a zip code and I want the
   global variable to get that value any time it’s changed. Is the global variable
   value only for a specific user?

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

 *  Plugin Author [akirak](https://wordpress.org/support/users/akirak/)
 * (@akirak)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/setting-variable-value/#post-15237878)
 * Hello,
 * The value won’t change per user and it will pull from globally configured value
   whenever you refer to it through either shortcode or the PHP code below.
 * shortcode
    [cgv variable-name]
 * PHP code
    <?php echo $GLOBALS[‘cgv’][‘variable-name’] ?>
 * If you want variables per user basis, those variables should be added to user
   entity as field via ACF or any custom fields.
 *  Thread Starter [LesTexas60](https://wordpress.org/support/users/lestexas60/)
 * (@lestexas60)
 * [4 years, 4 months ago](https://wordpress.org/support/topic/setting-variable-value/#post-15237914)
 * So if I set an ACF field for names. Three different people come to the site on
   a page and enter their names, from the front end. As long as they are on the 
   site, can I pull their name independant of the other people that are also on 
   the site? Does that make sense? I could probably do this with cookies but I was
   trying to avoid that process.
 *  Plugin Author [akirak](https://wordpress.org/support/users/akirak/)
 * (@akirak)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/setting-variable-value/#post-15388444)
 * That is not a proper usage for this plugin.
    User specific temporary data should
   be stored in a session or cookie. Thanks, Akira

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

The topic ‘Setting Variable value?’ is closed to new replies.

 * ![](https://ps.w.org/custom-global-variables/assets/icon-256x256.png?rev=1415125)
 * [Custom Global Variables](https://wordpress.org/plugins/custom-global-variables/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-global-variables/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-global-variables/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-global-variables/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-global-variables/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [akirak](https://wordpress.org/support/users/akirak/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/setting-variable-value/#post-15388444)
 * Status: not resolved