Created
April 11, 2016 11:40
-
-
Save websupporter/84bb10c69e04d3a80e01e678003a36a0 to your computer and use it in GitHub Desktop.
The old WP Ajax request
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 | |
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