public function job_exists($timestamp, $action, $instance, $return_id = false)
{
global $wpdb;
$exists = $wpdb->get_col($wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE post_name = %s AND post_type = %s AND post_status = %s LIMIT 1;", $this->event_name($timestamp, $action, $instance), self::POST_TYPE, self::POST_STATUS_PENDING));
if ($return_id) {
return empty($exists) ? 0 : (int) array_shift($exists);
} else {
return !empty($exists);
}
}