diff --git a/foodie_utils.py b/foodie_utils.py index cac7dfe..d36037b 100644 --- a/foodie_utils.py +++ b/foodie_utils.py @@ -516,13 +516,13 @@ def post_to_wp( Tuple of (post_id, post_url) or (None, None) if failed """ try: - # Load WordPress credentials from environment - wp_url = os.getenv('WORDPRESS_URL') - wp_username = os.getenv('WORDPRESS_USERNAME') - wp_password = os.getenv('WORDPRESS_PASSWORD') + # Get WordPress credentials from environment + wp_url = "https://insiderfoodie.com" + wp_username = author["username"] + wp_password = os.getenv(f"{wp_username.upper()}_PASSWORD") - if not all([wp_url, wp_username, wp_password]): - logger.error("Missing WordPress credentials in environment variables") + if not wp_password: + logger.error(f"Missing WordPress password for author {wp_username}") return None, None # Initialize WordPress API client