2

There are many frameworks that will provide a helper object for dealing with these variables i.e. symfony has a sfRequest object that has a member function getParameter() that can get used to get $_POST and $_GET variables.

I'm wondering if Wordpress has something similar to this? I've seen this solution that seems to append the new variables to the query_vars action, however some articles mention it will only work with GET. I was unable to get this to work with a form using both $_POST and $_GET myself, and certainly wouldn't think this is ideal to use if you have many variables that can be passed this way.

Is using plain old $_REQUEST, $_POST and $_GET the standard way to do work with request variables in Wordpress? Or is there a better way (specifically using the functions provided by Wordpress, rather than other libraries) to handle this?

4

1 回答 1

2

The closest thing I could find was the HTTP API, but that's only for sending requests. There's no wrapper class for dealing with such superglobals that's specific to WordPress.

于 2012-10-18T04:14:00.387 回答