Skip to content

Instantly share code, notes, and snippets.

@DamianSam
Forked from gicolek/blah.php
Created February 6, 2013 16:48
Show Gist options
  • Save DamianSam/4723914 to your computer and use it in GitHub Desktop.
Save DamianSam/4723914 to your computer and use it in GitHub Desktop.
<?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