*/ public function candidates(string $postType, string $search, bool $caseSensitive, int $limit, int $offset): array { $db = $this->db(); $forms = StoredForms::of($search, $caseSensitive); $likes = array_map( static fn (string $form): string => '%' . $db->esc_like($form) . '%', $forms ); $sql = "SELECT ID FROM {$db->posts} WHERE post_type = %s" . ' AND post_status NOT IN (' . PostStatuses::NOT_CONTENT . ')' . ' AND post_content LIKE %s AND (' . implode(' OR ', array_fill(0, count($likes), 'post_content LIKE %s')) . ')'; $args = array_merge([$postType, '%' . $db->esc_like(''; foreach ($block->isVoid() ? [] : $block->parts() as $part) { $markup .= $part instanceof Block ? self::withoutLibraryIds($part) : $part; } return $markup . ''; } /** Why an opaque node is not changed (global modules are edited in the Divi library, Etappe 3). */ private static function opaqueReason(Block $block): string { return $block->isGlobal() ? self::GLOBAL_REASON : 'Knoten nicht lesbar (Attribute kein JSON-Objekt) – im Divi-Builder bearbeiten'; } private function db(): \wpdb { return $this->db ?? $GLOBALS['wpdb']; } }