• I tested out the following and it returns an empty array.

    echo '<pre>';
    print_r( $_GET );
    echo '</pre>';

    Does WordPress destroy all the $_GET and $_POST data prior to the themes function.php?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    Not normally, but I suppose a particular theme could for some reason, such as redirecting a request or something. You should be able to prove it to yourself by hooking ‘init’ and sending the return of print_r( $_GET, true ) to a log file. This is after the theme is loaded but before anything related to a particular template happens.

    If that works, and all else fails, save the data you need from this hook to a global or something for later use.

    Dion

    (@diondesigns)

    What happens if you use this instead?

    echo '<pre>';
    print_r($_REQUEST);
    echo '</pre>';
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘using $_GET and $_POST in theme function.php?’ is closed to new replies.