Advertisement
BakerMan

tribe_has_wootickets() tpl tag (WT 1.0.1)

Apr 24th, 2013
894
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.33 KB | None | 0 0
  1. function tribe_has_wootickets($post_id = null) {
  2.     global $wpdb;
  3.     $id = TribeEvents::postIdHelper($post_id);
  4.  
  5.     $result = $wpdb->get_var($wpdb->prepare(
  6.         "SELECT COUNT(*) FROM $wpdb->postmeta WHERE meta_key = %s AND meta_value = %d LIMIT 1",
  7.         '_tribe_wooticket_for_event', $id
  8.     ));
  9.  
  10.     return (is_numeric($result) and $result > 0);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement