try
This commit is contained in:
+2
-2
@@ -456,7 +456,6 @@ def upload_image_to_wp(image_url, post_title, wp_base_url, wp_username, wp_passw
|
||||
logging.error(f"Failed to fetch image {image_url} after retries")
|
||||
return None
|
||||
|
||||
# Only proceed if image_response is defined (i.e., the fetch succeeded)
|
||||
if image_response is None:
|
||||
logging.error(f"Image response is None for {image_url}, cannot proceed with upload")
|
||||
return None
|
||||
@@ -470,7 +469,8 @@ def upload_image_to_wp(image_url, post_title, wp_base_url, wp_username, wp_passw
|
||||
|
||||
image_id = response.json()["id"]
|
||||
if page_url:
|
||||
caption = f'<a href="{page_url}">Image via {image_source}</a>'
|
||||
# Updated caption: "Image via" in grey, source name in default link color
|
||||
caption = f'<span style="color: grey;">Image via </span><a href="{page_url}">{image_source}</a>'
|
||||
else:
|
||||
caption = image_source
|
||||
requests.post(
|
||||
|
||||
Reference in New Issue
Block a user