• 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

    (@akirak)

    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

    (@lestexas60)

    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

    (@akirak)

    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.