Skip to content

Commit

Permalink
Allowed admin settings page options to still use custom sanitize call…
Browse files Browse the repository at this point in the history
…back.
  • Loading branch information
dfwood committed Oct 22, 2018
1 parent 908e79c commit da15612
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions includes/AdminSettingsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -201,7 +201,7 @@ public function registerSetting( Field $field ) {
}

return $field->value;
},
} ),
'show_in_rest' => $field->getData( 'show_in_rest', false ),
] );
}
Expand Down

0 comments on commit da15612

Please sign in to comment.