Skip to content

Instantly share code, notes, and snippets.

@websupporter
Created April 11, 2016 11:40
Show Gist options
  • Save websupporter/84bb10c69e04d3a80e01e678003a36a0 to your computer and use it in GitHub Desktop.
Save websupporter/84bb10c69e04d3a80e01e678003a36a0 to your computer and use it in GitHub Desktop.
The old WP Ajax request
<?php
add_action('wp_ajax_dn-query', 'dn_query');
function dn_query(){
$entries = array();
$entries = dn_messages_query();
if( count( $entries ) == 0 )
$entries = dn_notifications_query();
if( count( $entries ) == 0 )
$entries = dn_activities_query();
echo json_encode( apply_filters( 'dn_entries', $entries ) );
die();
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment