diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php index 2ccd46e9..3e81068f 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-data.php @@ -35,10 +35,10 @@ class SP_Meta_Box_Table_Data { * Save meta box data */ public static function save( $post_id, $post ) { - update_post_meta( $post_id, 'sp_highlight', sp_array_value( $_POST, 'sp_highlight', array() ) ); - update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array() ) ); - update_post_meta( $post_id, 'sp_adjustments', sp_array_value( $_POST, 'sp_adjustments', array() ) ); - update_post_meta( $post_id, 'sp_teams', sp_array_value( $_POST, 'sp_teams', array() ) ); + update_post_meta( $post_id, 'sp_highlight', sp_array_value( $_POST, 'sp_highlight', array(), 'int' ) ); + update_post_meta( $post_id, 'sp_columns', sp_array_value( $_POST, 'sp_columns', array(), 'text' ) ); + update_post_meta( $post_id, 'sp_adjustments', sp_array_value( $_POST, 'sp_adjustments', array(), 'text' ) ); + update_post_meta( $post_id, 'sp_teams', sp_array_value( $_POST, 'sp_teams', array(), 'text' ) ); } /** diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php index dc3b26f1..87b07179 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-details.php @@ -133,19 +133,19 @@ class SP_Meta_Box_Table_Details { * Save meta box data */ public static function save( $post_id, $post ) { - update_post_meta( $post_id, 'sp_caption', esc_attr( sp_array_value( $_POST, 'sp_caption', 0 ) ) ); - update_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0 ) ); - update_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null ) ); - update_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null ) ); - update_post_meta( $post_id, 'sp_date_past', sp_array_value( $_POST, 'sp_date_past', 0 ) ); - update_post_meta( $post_id, 'sp_date_relative', sp_array_value( $_POST, 'sp_date_relative', 0 ) ); + update_post_meta( $post_id, 'sp_caption', esc_attr( sp_array_value( $_POST, 'sp_caption', 0, 'text' ) ) ); + update_post_meta( $post_id, 'sp_date', sp_array_value( $_POST, 'sp_date', 0, 'text' ) ); + update_post_meta( $post_id, 'sp_date_from', sp_array_value( $_POST, 'sp_date_from', null, 'text' ) ); + update_post_meta( $post_id, 'sp_date_to', sp_array_value( $_POST, 'sp_date_to', null, 'text' ) ); + update_post_meta( $post_id, 'sp_date_past', sp_array_value( $_POST, 'sp_date_past', 0, 'text' ) ); + update_post_meta( $post_id, 'sp_date_relative', sp_array_value( $_POST, 'sp_date_relative', 0, 'text' ) ); $tax_input = sp_array_value( $_POST, 'tax_input', array() ); update_post_meta( $post_id, 'sp_main_league', in_array( 'auto', sp_array_value( $tax_input, 'sp_league' ) ) ); update_post_meta( $post_id, 'sp_current_season', in_array( 'auto', sp_array_value( $tax_input, 'sp_season' ) ) ); - update_post_meta( $post_id, 'sp_select', sp_array_value( $_POST, 'sp_select', array() ) ); - sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array() ) ); - update_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array() ) ); - update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array() ) ); - update_post_meta( $post_id, 'sp_event_status', sp_array_value( $_POST, 'sp_event_status', array() ) ); + update_post_meta( $post_id, 'sp_select', sp_array_value( $_POST, 'sp_select', array(), 'key' ) ); + sp_update_post_meta_recursive( $post_id, 'sp_team', sp_array_value( $_POST, 'sp_team', array(), 'int' ) ); + update_post_meta( $post_id, 'sp_orderby', sp_array_value( $_POST, 'sp_orderby', array(), 'key' ) ); + update_post_meta( $post_id, 'sp_order', sp_array_value( $_POST, 'sp_order', array(), 'text' ) ); + update_post_meta( $post_id, 'sp_event_status', sp_array_value( $_POST, 'sp_event_status', array(), 'key' ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-format.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-format.php index 8b0858d8..cc83a0fb 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-format.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-format.php @@ -34,6 +34,6 @@ class SP_Meta_Box_Table_Format { * Save meta box data */ public static function save( $post_id, $post ) { - update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'standings' ) ); + update_post_meta( $post_id, 'sp_format', sp_array_value( $_POST, 'sp_format', 'standings', 'key' ) ); } } \ No newline at end of file diff --git a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php index b601d382..06d230e9 100644 --- a/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php +++ b/includes/admin/post-types/meta-boxes/class-sp-meta-box-table-mode.php @@ -33,6 +33,6 @@ class SP_Meta_Box_Table_Mode { * Save meta box data */ public static function save( $post_id, $post ) { - update_post_meta( $post_id, 'sp_mode', sp_array_value( $_POST, 'sp_mode', 'team' ) ); + update_post_meta( $post_id, 'sp_mode', sp_array_value( $_POST, 'sp_mode', 'team', 'key' ) ); } } \ No newline at end of file