Created
February 6, 2013 16:47
-
-
Save gicolek/4723908 to your computer and use it in GitHub Desktop.
Handle ajax requests (omitting admin-ajax.php)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function _foo_handle_ajax_request_for_db_data() { | |
$path = parse_url (site_url()); | |
if ( parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) === $path['path'] . '/sth' ) { | |
status_header(200); | |
// do sth | |
exit ; | |
} | |
} | |
add_action('init', '_foo_handle_ajax_request_for_db_data'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment