Last active
September 2, 2016 18:34
-
-
Save sjaved87/ac4284f1d7b4408986e3e25587d5fbe4 to your computer and use it in GitHub Desktop.
WPMU DEV Events+ plugin - This snippet will count and return the active events.
This file contains 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 | |
function get_active_events_count(){ | |
global $wpdb; | |
$count = $wpdb->get_var( | |
$wpdb->prepare( | |
"SELECT count(*) | |
FROM $wpdb->postmeta | |
WHERE meta_key = %s | |
and meta_value = %s ", | |
'incsub_event_status', | |
'open' | |
) | |
); | |
return $count; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment