From bb6c518edada9e94b8ad3da8bc0c226383e2e223 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Sat, 6 Nov 2021 11:20:46 +0900 Subject: [PATCH] Sanitize staff meta boxes --- .../meta-boxes/class-sp-meta-box-staff-details.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 9b08d01e..0a1b6367 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 @@ -150,9 +150,9 @@ class SP_Meta_Box_Staff_Details { * Save meta box data */ public static function save( $post_id, $post ) { - sp_update_post_meta_recursive( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', array() ) ); - sp_update_post_meta_recursive( $post_id, 'sp_current_team', sp_array_value( $_POST, 'sp_current_team', array() ) ); - 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() ) ) ); + sp_update_post_meta_recursive( $post_id, 'sp_nationality', sp_array_value( $_POST, 'sp_nationality', array(), 'key' ) ); + sp_update_post_meta_recursive( $post_id, 'sp_current_team', sp_array_value( $_POST, 'sp_current_team', array(), 'id' ) ); + sp_update_post_meta_recursive( $post_id, 'sp_past_team', sp_array_value( $_POST, 'sp_past_team', array(), 'id' ) ); + sp_update_post_meta_recursive( $post_id, 'sp_team', array_merge( array( sp_array_value( $_POST, 'sp_current_team', array(), 'id' ) ), sp_array_value( $_POST, 'sp_past_team', array(), 'id' ) ) ); } }