• Resolved richarduk

    (@richarduk)


    I’m setting up an options page and uploading an image which has to be validated.
    If there’s an error I want to set a variable to pass to another function, but I can’t get it to work at all.

    Essentially the code goes like this, where $banner_error is the global variable I’m trying to set. If I echo a message at that point instead of setting a variable then the message is echoed (‘headers already sent’ as well but that doesn’t matter since I’m just testing):

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Original code from: https://blogs.sitepoint.com/wordpress-options-panel/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Passing global variable from one function to another not working’ is closed to new replies.