[wp-trac] [WordPress Trac] #25669: Introduce helper function for AJAX checks
WordPress Trac
noreply at wordpress.org
Mon Feb 15 08:21:47 UTC 2016
#25669: Introduce helper function for AJAX checks
------------------------------------+------------------------------
Reporter: toscho | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bootstrap/Load | Version:
Severity: normal | Resolution:
Keywords: dev-feedback has-patch | Focuses:
------------------------------------+------------------------------
Comment (by sebastian.pisula):
I think that this function with filter - this is good idea. But I suggest
add to core new constant:
{{{#!php
<?php
define( 'WP_IS_AJAX', ( ! empty( $_SERVER['HTTP_X_REQUESTED_WITH'] ) &&
strtolower( $_SERVER['HTTP_X_REQUESTED_WITH'] ) == 'xmlhttprequest' ) );
}}}
Patch 25669.2.patch
--
Ticket URL: <https://core.trac.wordpress.org/ticket/25669#comment:19>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list