diff --git a/includes/AdminSettingsPage.php b/includes/AdminSettingsPage.php index 82e11e9..15f25fe 100644 --- a/includes/AdminSettingsPage.php +++ b/includes/AdminSettingsPage.php @@ -191,7 +191,7 @@ public function registerSetting( Field $field ) { 'type' => \gettype( $field->value ), 'default' => $field->value, 'description' => $field->getData( 'description', '' ), - 'sanitize_callback' => function ( $value ) use ( $field ) { + 'sanitize_callback' => $field->getData( 'sanitize', function ( $value ) use ( $field ) { $is_valid = validate_flex_field( $field ); if ( $is_valid ) { @@ -201,7 +201,7 @@ public function registerSetting( Field $field ) { } return $field->value; - }, + } ), 'show_in_rest' => $field->getData( 'show_in_rest', false ), ] ); }