Update homepage pledge image rotation for federal.
This commit is contained in:
@@ -15,11 +15,11 @@ $candidate_data = parse_pledge_data(explode(" ", $candidates_files), null);
|
||||
|
||||
/* Select people who have taken the pledge (and have an image) */
|
||||
$pledgeCandidates = array_filter($candidate_data, function ($candidate) {
|
||||
return $candidate['Pledge'] === 'y' && $candidate['Picture'] !== "";
|
||||
return $candidate['Pledge'] === 'Yes' && $candidate['Picture'] !== "";
|
||||
});
|
||||
|
||||
/* Select 9 random candidates */
|
||||
$pledgeKeys = array_rand($pledgeCandidates, 9);
|
||||
$pledgeKeys = array_rand($pledgeCandidates, min(count($pledgeCandidates), 9));
|
||||
shuffle($pledgeKeys);
|
||||
|
||||
$i = 0;
|
||||
|
||||
Reference in New Issue
Block a user