From 426a799371cf8aa0f748a821a06b26b9834820c5 Mon Sep 17 00:00:00 2001 From: OliverGiertz Date: Sun, 29 Mar 2026 14:29:25 +0000 Subject: [PATCH] fix(wordpress): use status=future for posts with a future scheduled_publish_at MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WordPress ignores the date field for draft posts and shows "Sofort veröffentlichen" instead. Setting status=future causes WP to display and honour the scheduled date, auto-publishing the post at the given time as intended. Co-Authored-By: Claude Sonnet 4.6 --- backend/app/wordpress.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/app/wordpress.py b/backend/app/wordpress.py index 912e85c..8b6d5a0 100644 --- a/backend/app/wordpress.py +++ b/backend/app/wordpress.py @@ -446,6 +446,14 @@ def publish_article_draft(article: dict[str, Any]) -> tuple[int, str | None]: scheduled_at = article.get("scheduled_publish_at") if scheduled_at: payload["date"] = scheduled_at # e.g. "2026-03-24T09:00:00" + # Use status "future" so WP schedules auto-publishing at the given date. + # WP ignores date for drafts and shows "Sofort veröffentlichen" instead. + try: + from datetime import datetime as _dt + if _dt.fromisoformat(scheduled_at) > _dt.now(): + payload["status"] = "future" + except Exception: + pass wp_post_id = article.get("wp_post_id") tag_ids = _resolve_wp_tag_ids(