Skip to content

Instantly share code, notes, and snippets.

@thefrosty
Created March 4, 2015 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thefrosty/9bdb8e43597c52ab065c to your computer and use it in GitHub Desktop.
Save thefrosty/9bdb8e43597c52ab065c to your computer and use it in GitHub Desktop.
For testing perposes. This responds with 'heartbeat' when running. But when Clicking 'insert into post' or insert custom link (nav menu) among a few others the POST action never get's triggered. In my console I get 302 found, then a GET request to the home page. Example video: http://quick.as/1oovhyzj
if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) {
die($_POST['action']);
add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment