Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Jamie Fraser

    (@thejfraser)

    Hi Leandro,

    There should be support for

    global $PHPPC;
    $myvar = $PHPPC->$_vars["myvaridentifer"];

    So you can use $PHPPC->$_vars; to pass data between code and snippets.

    Cheers

    I have successfully gotten this to work (using :: instead of ->) when passing data between snippets but am having no luck passing data back to the calling page. Any ideas?

    I’ve tried :

    $myvar = PhpCodeForPosts::$_vars[“myvar”];
    echo ‘MyVar ‘ . $myvar;

    and

    global $PHPPC;
    $myvar = $PHPPC::$_vars[“myvar”];
    echo ‘MyVar ‘ . $myvar;

    Plugin Author Jamie Fraser

    (@thejfraser)

    yep, there is an error in my syntax above
    it should read

    global $PHPPC;
    $myvar = $PHPPC->_vars["myvaridentifer"];

    jhannon – the vars can only pass data around snippets on a single page load

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Variables declared in functions.php not accessible from plugin’ is closed to new replies.