Skip to content

Commit

Permalink
Fix admin option parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoColomb committed Dec 16, 2018
1 parent ef3fcde commit 3879847
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 68 deletions.
10 changes: 10 additions & 0 deletions src/class-wp-auto-links-helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,16 @@ public function show_options()
include dirname(__DIR__).'/templates/admin.php';
}

/**
* @param mixed $value
* @param int $null
* @return int
*/
public static function option_integer($value, int $null = 0): int
{
return (is_numeric($value) && $value > 0) ? (int) $value : $null;
}

/**
* Instantiate the filter.
*
Expand Down
Loading

0 comments on commit 3879847

Please sign in to comment.