Make sure wp_list_pluck() is fed an array

This commit is contained in:
Nabil Kadimi
2018-02-22 17:35:41 +00:00
committed by GitHub
parent 87887a38aa
commit 4844945c26

View File

@@ -49,7 +49,7 @@ class SP_Meta_Box_Staff_Details {
endif; endif;
$roles = get_the_terms( $post->ID, 'sp_role' ); $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 ) ); $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 ) ); $past_teams = array_filter( get_post_meta( $post->ID, 'sp_past_team', false ) );