diff --git a/admin/functions.php b/admin/functions.php index 4430e4f3..4d75de6d 100644 --- a/admin/functions.php +++ b/admin/functions.php @@ -56,6 +56,57 @@ function wpt_default_option( $page ){ } } +/** + * Remove empty Array value from an Multi-dimensional Array + * I have taken help from a stackoverflow tips. + * + * @param Array $array Obviously should be an Array + * @return Array + * + * @link https://stackoverflow.com/questions/9895130/recursively-remove-empty-elements-and-subarrays-from-a-multi-dimensional-array + * + */ +function wpt_remove_empty_value_from_array( $array ){ + + + if( ! is_array( $array ) ) return $array; + // foreach($array as $key=>&$arr){ + // if( empty( $arr ) ){ + // unset( $array[$key] ); + // } + // if( is_array($arr) ){ + // wpt_remove_empty_value_from_array( $arr ); + // } + // } + // return $array; + + // $array = array_filter($array,function($val){ + // if( is_array( $val ) ){ + // return wpt_remove_empty_value_from_array( $val ); + // } + // return ! empty($val); + // }); + + // $array = array_filter(array_map('array_filter', $array)); + // return $array; + + foreach ($array as $key => &$value) { + if ( ! is_bool( $value ) && empty($value)) { + unset($array[$key]); + } + else { + if (is_array($value)) { + $value = wpt_remove_empty_value_from_array($value); + if (! is_bool( $value ) && empty($value)) { + unset($array[$key]); + } + } + } + } + + return $array; +} + /** diff --git a/admin/post_metabox.php b/admin/post_metabox.php index 279c0209..0d09e51a 100644 --- a/admin/post_metabox.php +++ b/admin/post_metabox.php @@ -343,8 +343,8 @@ function wpt_shortcode_configuration_metabox_save_meta( $post_id, $post ) { // s ); $submitte_data = filter_input_array( INPUT_POST, $filtar_args ); - $submitte_data = array_filter( $submitte_data ); + $submitte_data = wpt_remove_empty_value_from_array($submitte_data); /********* Column Setting Optimizing Start here ***********/ //Fixing for tablet setting @@ -461,9 +461,10 @@ function wpt_shortcode_configuration_metabox_save_meta( $post_id, $post ) { // s * Only for customer use at this moment. */ $tab_data = apply_filters( 'wpto_tab_data_on_save_' . $tab, $tab_data, $post_id, $save_tab_array ); + $tab_data = wpt_remove_empty_value_from_array( $tab_data ); update_post_meta( $post_id, $tab, $tab_data ); } - + /** * @Hook Action: wpto_on_save_post * To change data when Form will save. diff --git a/assets/css/templates/beautiful_blacky.css b/assets/css/templates/beautiful_blacky.css index 5e66352e..0e739a00 100644 --- a/assets/css/templates/beautiful_blacky.css +++ b/assets/css/templates/beautiful_blacky.css @@ -662,4 +662,8 @@ body.wpt_table_body .beautiful_blacky_wrapper .wpt_search_box .search_box_wrappe .woocommerce-noreviews, p.no-comments { background-color: #37aee9 !important; +} + +div.wpt-footer-cart-wrapper>a:after, div.wpt-footer-cart-wrapper>a { + background-color: #37aee9 !important; } \ No newline at end of file diff --git a/assets/css/templates/default.css b/assets/css/templates/default.css index 8fbbb106..dc83d080 100644 --- a/assets/css/templates/default.css +++ b/assets/css/templates/default.css @@ -694,4 +694,4 @@ body.wpt_table_body .default_wrapper button:focus { background-color: transparent; border: 1px solid var(--wpt-default-primary); color: var(--wpt-default-primary); -} \ No newline at end of file +} diff --git a/includes/functions.php b/includes/functions.php index b92af49e..7de065aa 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1093,8 +1093,9 @@ function wpt_get_value_with_woocommerce_unit( $target_unit, $value ){ function wpt_adding_body_class( $class ) { global $post,$shortCodeText; - - if( isset($post->post_content) && has_shortcode( $post->post_content, $shortCodeText ) ) { + + if( ( isset($post->post_content) && has_shortcode( $post->post_content, $shortCodeText ) ) + || $post->post_type == 'wpt_product_table' ) { $class[] = 'wpt_table_body'; $class[] = 'woocommerce'; }