getName()}_status" => FieldFactory::addSelect( "{$this->getName()}_status", [ 'conditions' => [["{$this->target->getName()}_condition_type", $this->getName()]], 'label' => \__('Post status', 'adr'), 'values' => static function (): array { foreach (\get_post_statuses() as $postStatus => $postStatusName) { $values[] = ['value' => $postStatus, 'label' => $postStatusName]; } return $values ?? []; }, ] ), ]; } public function executeQuery(QueryProcessor $queryProcessor, string $parentKey = ''): void { global $wpdb; $postStatus = Sanitizer::sanitizePost("{$parentKey}.{$this->getName()}_status", FILTER_SANITIZE_STRING); if (false === $postStatus) { $queryProcessor->lastError = \sprintf( \__('%s condition contain not allowed values!', 'adr'), $this->getDisplayName() ); return; } $queryProcessor->setWhere("{$wpdb->posts}.post_status", '=', "'{$postStatus}'"); } }