From 93d7ccf68dc9c0ac29799b34e250d632d9982236 Mon Sep 17 00:00:00 2001 From: Ian Dunn Date: Wed, 17 Aug 2022 11:50:40 -0700 Subject: [PATCH] Contributors: Standardize on `team_names` field for consistency. --- plugins/wporg-5ftf/includes/contributor.php | 2 +- plugins/wporg-5ftf/includes/email.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/wporg-5ftf/includes/contributor.php b/plugins/wporg-5ftf/includes/contributor.php index 20aeced..26951cd 100644 --- a/plugins/wporg-5ftf/includes/contributor.php +++ b/plugins/wporg-5ftf/includes/contributor.php @@ -745,7 +745,7 @@ function add_user_data_to_xprofile( array $xprofiles ) : array { $full_user['last_logged_in'] = intval( strtotime( $full_user['last_logged_in'] ?? '' ) ); // Convert `false` to `0`. $full_user['5ftf_last_inactivity_email'] = intval( $full_user['5ftf_last_inactivity_email'] ?? 0 ); - $full_user['teams_names'] = (array) maybe_unserialize( $xprofiles[ $user->ID ]->team_names ); + $full_user['team_names'] = (array) maybe_unserialize( $xprofiles[ $user->ID ]->team_names ); $full_users[] = $full_user; } diff --git a/plugins/wporg-5ftf/includes/email.php b/plugins/wporg-5ftf/includes/email.php index 2538a51..ea99b05 100644 --- a/plugins/wporg-5ftf/includes/email.php +++ b/plugins/wporg-5ftf/includes/email.php @@ -222,7 +222,7 @@ function send_contributor_inactive_email( array $contributor ) : bool { $team = str_replace( 'Team', '', $team ); return trim( $team ); - }, $contributor['teams_names'] ); + }, $contributor['team_names'] ); $message = sprintf( " Hi %s, a while ago you pledged to contribute %d %s a week to the %s %s: @@ -250,7 +250,7 @@ function send_contributor_inactive_email( array $contributor ) : bool { $contributor['hours_per_week'], 1 === $contributor['hours_per_week'] ? 'hour' : 'hours', natural_language_join( $short_team_names ), - 1 === count( $contributor['teams_names'] ) ? 'team' : 'teams', + 1 === count( $contributor['team_names'] ) ? 'team' : 'teams', $contributor['user_nicename'] ); $message = str_replace( "\t", '', trim( $message ) );