Skip to content

Commit 2247605

Browse files
add sanitization function
1 parent 909abbd commit 2247605

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

includes/classes/class-settings.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function register_settings_fields() {
101101
// Run through each group, and the fields in there.
102102
foreach ( $fields as $group => $fields ) {
103103
foreach ( $fields as $field_key => $args ) {
104-
register_setting( 'kkd-pff-paystack-settings-group', $field_key );
104+
register_setting( 'kkd-pff-paystack-settings-group', $field_key, [ $this, 'sanitise_field' ] );
105105
}
106106
}
107107
}
@@ -191,4 +191,15 @@ public function is_option_selected( $value, $compare ) {
191191
}
192192
return $result;
193193
}
194+
195+
/**
196+
* Checks to see if the curren value is selected.
197+
*
198+
* @param string $value
199+
* /
200+
*
201+
*/
202+
private function sanitise_field( $value ) {
203+
return sanitize_text_field( $value );
204+
}
194205
}

0 commit comments

Comments
 (0)