Use default image for candidates who have signed the ledge, but not provided an image.

This commit is contained in:
Kim Taylor
2024-09-25 14:38:13 +10:00
parent 620d1bf06d
commit 8543bc1c53
3 changed files with 30 additions and 7 deletions

View File

@@ -5,6 +5,7 @@
# The folder containing data for each council.
# Includes the list of candidates and any media.
DATA_PATH="../spl-data"
DEFAULT_IMAGE="../spl-data/default.png.json"
# Iterate over folders in data path
candidates_files=()
@@ -17,6 +18,7 @@ for folder in "$DATA_PATH"/*; do
fi
done
content=$(php pledge-update/pledge-page.php --candidates-files "${candidates_files[*]}")
content=$(php pledge-update/pledge-page.php --candidates-files "${candidates_files[*]}" \
--default-image $DEFAULT_IMAGE)
wp post update 12106 --post_content="$content"
echo "$content" | wp post update 12106 -