null, 'created_at' => time(), 'items' => [], 'parity_warnings' => [], 'done' => [], ]; } $known = array_column( $queue['items'], 'id' ); foreach ( $items as $item ) { if ( ! in_array( $item['id'], $known, true ) ) { $item['context'] = (string) $context; $queue['items'][] = $item; } } // A re-queued post must be visited again even if an earlier pass marked it done — its // content just changed. $queue['done'] = array_values( array_diff( array_map( 'intval', $queue['done'] ?? [] ), array_column( $items, 'id' ) ) ); self::put( $queue ); } /** * Filter post ids down to the ones a block editor could actually validate. * * @param array $post_ids * @return array */ private static function eligible_items( array $post_ids ): array { $items = []; foreach ( array_unique( array_map( 'intval', $post_ids ) ) as $post_id ) { $post = get_post( $post_id ); if ( ! $post || in_array( $post->post_type, self::SKIPPED_POST_TYPES, true ) ) { continue; } // No block delimiters means nothing for a block editor to validate. if ( false === strpos( (string) $post->post_content, '