Skip to content

Commit 85cdbd4

Browse files
committed
Don’t sanitize if it has a falsy value
1 parent 568b99b commit 85cdbd4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/class.settings-api.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,15 @@ function callback_color( $args ) {
404404

405405
/**
406406
* Sanitize callback for Settings API
407+
*
408+
* @return mixed
407409
*/
408410
function sanitize_options( $options ) {
411+
412+
if ( !$options ) {
413+
return $options;
414+
}
415+
409416
foreach( $options as $option_slug => $option_value ) {
410417
$sanitize_callback = $this->get_sanitize_callback( $option_slug );
411418

0 commit comments

Comments
 (0)