Automattic\WP\Cron_Control\Cron_Options_CPT::job_exists PHP Метод

job_exists() публичный Метод

Uses a direct query to avoid stale caches that result in duplicate events
public job_exists ( $timestamp, $action, $instance, $return_id = false )
    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);
        }
    }