Skip to content

Commit 07f0b24

Browse files
committed
fix save settings
1 parent fe749a1 commit 07f0b24

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

includes/class-ajax.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public function wcct_save_settings() {
3434
}
3535

3636
$integration_settings = array();
37-
$post_data = isset( $_POST['settings'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['settings'] ) ) : [];
37+
// $post_data = isset( $_POST['settings'] ) ? array_map( 'sanitize_text_field', wp_unslash( $_POST['settings'] ) ) : [];
3838

39-
if ( ! empty( $post_data ) ) {
39+
if ( ! empty( $_POST['settings'] ) ) {
4040

41-
foreach ( $post_data as $field_id => $settings ) {
41+
foreach ( $_POST['settings'] as $field_id => $settings ) {
4242
$is_enabled = isset( $settings['enabled'] ) ? true : false;
4343

4444
$settings = array_merge( $settings, array( 'enabled' => $is_enabled ) );

0 commit comments

Comments
 (0)