From 4844945c2687af53d57277fdbc6aa49c1beec45d Mon Sep 17 00:00:00 2001 From: Nabil Kadimi Date: Thu, 22 Feb 2018 17:35:41 +0000 Subject: [PATCH] Make sure `wp_list_pluck()` is fed an array --- .../post-types/meta-boxes/class-sp-meta-box-staff-details.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php index dbfcc812..e73d0804 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-staff-details.php @@ -49,7 +49,7 @@ class SP_Meta_Box_Staff_Details { endif; $roles = get_the_terms( $post->ID, 'sp_role' ); - $role_ids = wp_list_pluck( $roles, 'term_id' ); + $role_ids = is_array( $roles ) ? wp_list_pluck( $roles, 'term_id' ) : array(); $teams = get_posts( array( 'post_type' => 'sp_team', 'posts_per_page' => -1 ) ); $past_teams = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) ); @@ -155,4 +155,4 @@ class SP_Meta_Box_Staff_Details { sp_update_post_meta_recursive( $post_id, 'sp_past_team', sp_array_value( $_POST, 'sp_past_team', array() ) ); sp_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sp_array_value( $_POST, 'sp_current_team', array() ) ), sp_array_value( $_POST, 'sp_past_team', array() ) ) ); } -} \ No newline at end of file +}