[wp-hackers] admin-ajax.php and $_GET?
otto at ottodestruct.com
Wed Oct 22 14:01:17 GMT 2008
Oh, I see what you're saying there...
Yes, it might make sense to allow a hook there for the get[action]
piece, but not necessary at that point because you're inside the
switchcase on the posted action. Maybe allowing a get based switchcase
at the top of that file as well would be useful here...
On Wed, Oct 22, 2008 at 8:54 AM, Otto <otto at ottodestruct.com> wrote:
> GET and POST serve two entirely different purposes, and POST is the
> correct one in this case.
> GET is for situations where you are getting some data back from the server.
> POST is for situations where you are sending something to the server.
> The main difference is that browsers can cache the results of a GET
> request, and if you do the same GET twice, then the second time you'll
> get cached data, it won't hit the server.
> On Tue, Oct 21, 2008 at 11:25 PM, Casey Bisson <casey.bisson at gmail.com> wrote:
>> Was it a conscious decision to limit the action hook in admin-ajax.php to
>> $_POST vars only?
>> do_action( 'wp_ajax_' . $_POST['action'] );
>> Or could we just as easily do something like this:
>> do_action( 'wp_ajax_' . ( $_POST['action'] ? $_POST['action'] :
>> $_GET['action'] ));
>> We probably can't/shouldn't use $_REQUEST in this context, as cookies have
>> precedence, but the above would make something I'm working on now a lot
>> I'd probably just work around it, but seeing that the "ajax-tag-search"
>> action uses a GET suggests there can't be too many arguments against GET.
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
More information about the wp-hackers