From e076f1ccb2edde0e3f88af1fc6b50b62c2bfa3a7 Mon Sep 17 00:00:00 2001 From: Joldis Mihai Alexandru Date: Sat, 7 Feb 2015 20:47:27 +0200 Subject: [PATCH] Categories view mode Fixes display type for categories overwriting the Presentation settings when selecting Default as option --- wpsc-admin/includes/save-data.functions.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wpsc-admin/includes/save-data.functions.php b/wpsc-admin/includes/save-data.functions.php index 55442401c0..921fce58ae 100755 --- a/wpsc-admin/includes/save-data.functions.php +++ b/wpsc-admin/includes/save-data.functions.php @@ -526,8 +526,12 @@ function wpsc_save_category_set( $category_id, $tt_id ) { wpsc_update_categorymeta( $category_id, 'active', '1' ); wpsc_update_categorymeta( $category_id, 'order', '0' ); - if ( isset( $_POST['display_type'] ) ) { + //Save category display type. + //If select option is "default" then remove the meta since the view will respect the setting under Presentation page. + if ( isset( $_POST['display_type'] ) && $_POST['display_type'] != 'default' ) { wpsc_update_categorymeta( $category_id, 'display_type', esc_sql( stripslashes( $_POST['display_type'] ) ) ); + } else { + wpsc_delete_categorymeta( $category_id, 'display_type' ); } if ( isset( $_POST['image_height'] ) ) {