Skip to content

Conversation

@IanDelMar
Copy link
Contributor

@IanDelMar IanDelMar commented Jan 17, 2026

Widens the callable-typed parameters to also allow the default value ''. Related: #289.

Affected:

  • Custom_Background::__construct()
  • Custom_Image_Header::__construct()

Also makes the callable type explicit by adding parameter and return types. These callables are either hooked to admin_head-{$page}, which does not pass any arguments, or passed to call_user_func() without arguments. As an action hook, admin_head-{$page} expects a callable with a void return type. call_user_func() is used in a template context where side effects are expected, but no return value is used. Hence, callable(): void.

@IanDelMar IanDelMar marked this pull request as draft January 17, 2026 19:24
@IanDelMar IanDelMar changed the title Widen type to allow default value in Custom_Background::__construct Widen callable type to allow empty string default value Jan 17, 2026
@IanDelMar IanDelMar marked this pull request as ready for review January 17, 2026 19:59
@szepeviktor szepeviktor merged commit 8ed494f into php-stubs:master Jan 17, 2026
7 checks passed
@IanDelMar IanDelMar deleted the custum-background-callable branch January 18, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants