Skip to content

Instantly share code, notes, and snippets.

@jmcausing
Created May 23, 2020 16:48
Show Gist options
  • Save jmcausing/efedc456f24e64d830cd50b1832bff33 to your computer and use it in GitHub Desktop.
Save jmcausing/efedc456f24e64d830cd50b1832bff33 to your computer and use it in GitHub Desktop.
if ( wp_doing_ajax() )
{
echo "admin-ajax.php is here...<br>";
// Check which action is using that ajax..
$ajax_action = $_REQUEST['action'];
echo "It is calling this action: <br>" . $ajax_action . "<br>";
// Is this called in admin?
$is_ajax_in_admin = is_admin();
if ($is_ajax_in_admin == 1) { echo " this is called in Admin.."; }
// check url
echo $_SERVER['REQUEST_URI'];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment