Skip to content

Commit

Permalink
allow 0 args for int and mixed filter
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmuffme committed Apr 1, 2024
1 parent 0130a4e commit 3f4689a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,9 @@ public static function getFunctionParams( FunctionParamsProviderEvent $event ) :
$return_type = $hook['types'][0];

// for bool we can use 0, so "__return_true" and "__return_false" can be used without error, as for bool only (!) filters the previous value doesn't matter
if ( $return_type->isBool() ) {
// allow this for "mixed" too, since it could be bool and we don't want to force types on badly/non-documented filters
// same for single int type, where any previously filtered in values are often irrelevant
if ( $return_type->isBool() || $return_type->isMixed() || $return_type->isInt() ) {
$min_args = 0;
}
} else {
Expand Down

0 comments on commit 3f4689a

Please sign in to comment.