Landing page shuffles all people who have taken the pledge and uploaded a picture.
This commit is contained in:
@@ -11,11 +11,11 @@ if (isset($options['candidates-files'])) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$candidate_data = parse_pledge_data(explode(" ", $candidates_files));
|
||||
$candidate_data = parse_pledge_data(explode(" ", $candidates_files), null);
|
||||
|
||||
/* Select people who have taken the pledge */
|
||||
/* Select people who have taken the pledge (and have an image) */
|
||||
$pledgeCandidates = array_filter($candidate_data, function ($candidate) {
|
||||
return $candidate['Pledge'] === 'y';
|
||||
return $candidate['Pledge'] === 'y' && $candidate['Picture'] !== "";
|
||||
});
|
||||
|
||||
/* Select 9 random candidates */
|
||||
|
||||
@@ -17,7 +17,8 @@ candidates_files=()
|
||||
for folder in "$DATA_PATH"/*; do
|
||||
if test -f "$folder"/candidates.csv; then
|
||||
candidates_files+=("$folder"/candidates.csv)
|
||||
elif test -f "$folder"/candidates-generic.csv; then
|
||||
fi
|
||||
if test -f "$folder"/candidates-generic.csv; then
|
||||
candidates_files+=("$folder"/candidates-generic.csv)
|
||||
fi
|
||||
done
|
||||
@@ -26,4 +27,4 @@ pledge_sed=$(php pledge-update/homepage.php --candidates-files "${candidates_fil
|
||||
|
||||
content=$(sed "$pledge_sed" ../spl-data/movie-homepage)
|
||||
|
||||
wp post update 1803 --post_content="$content"
|
||||
echo "$content" | wp post update 1803 -
|
||||
|
||||
Reference in New Issue
Block a user