From 24a73b63240f274c850b29e2e6e9bbb2ebd8c269 Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Thu, 5 Dec 2019 15:00:28 -0800 Subject: [PATCH] Use `FIELD_IDS` instead of hardcoding for DRYness. --- plugins/wporg-5ftf/includes/xprofile.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/wporg-5ftf/includes/xprofile.php b/plugins/wporg-5ftf/includes/xprofile.php index 2f31a6e..12313de 100644 --- a/plugins/wporg-5ftf/includes/xprofile.php +++ b/plugins/wporg-5ftf/includes/xprofile.php @@ -71,11 +71,11 @@ function get_aggregate_contributor_data_for_pledge( $pledge_id ) { $aggregate_data = array_reduce( $data, function( $carry, $item ) { switch ( $item['field_id'] ) { - case 29: // Hours. + case FIELD_IDS['hours_per_week']: $carry['hours'] += absint( $item['value'] ); break; - case 30: // Teams. + case FIELD_IDS['team_names']: $value = (array) maybe_unserialize( $item['value'] ); $carry['teams'] = array_merge( $carry['teams'], $value ); break;