[wp-hackers] ajax to call function in theme

Dylan Kuhn dylankkuhn at gmail.com
Fri Dec 25 14:18:08 UTC 2009


Sorry, my previous response was poorly written. For anyone else
experiencing this problem: I was _not_ able to reproduce it when I
tried again. The snippet of code I included is _already_ in WP 2.8.6
(and earlier, I think), and should prevent redirect_canonical() from
redirecting POST requests that actually have data. So I can only
speculate about what was causing the 301 I originally observed.

-dylan-

On Thu, Dec 24, 2009 t 10:06 PM, Dion Hulse (dd32) <wordpress at dd32.id.au> wrote:
> Open a trac ticket at http://core.trac.wordpress.org/newticket with your
> request :)
>
> On Fri, 25 Dec 2009 15:58:16 +1100, Dylan Kuhn <dylankkuhn at gmail.com> wrote:
>
>>> The canonical redirection code is probably at play here.
>>
>> Thanks for the hint - I think you are probably right, and that I had a
>> bug in my POST request. When I tried to reproduce the problem,
>> thinking I would spit out some useful debugging information from
>> redirect_canonical(), it worked.  But I was happy to see this code
>> there, which should let any POST request with data through:
>>
>> function redirect_canonical($requested_url=null, $do_redirect=true) {
>>        global $wp_rewrite, $is_IIS, $wp_query, $wpdb;
>>
>>        if ( is_trackback() || is_search() || is_comments_popup() ||
>> is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) ||
>> is_preview() || is_robots() )
>>                return;
>>


More information about the wp-hackers mailing list