Skip to content

Commit 7945595

Browse files
authored
Fix $callback type for add_submenu_page (#161)
The default type for $callback is ''. Since there are parameters after $callback, we must support the default as well.
1 parent 618eed0 commit 7945595

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

functionMap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
*/
2626
return [
2727
'addslashes_gpc' => ['T', '@phpstan-template' => 'T', 'gpc' => 'T'],
28+
'add_submenu_page' => [null, 'callback' => "''|callable"],
2829
'have_posts' => [null, '@phpstan-impure' => ''],
2930
'rawurlencode_deep' => ['T', '@phpstan-template' => 'T', 'value' => 'T'],
3031
'sanitize_category' => ['T', '@phpstan-template' => 'T of array|object', 'category' => 'T'],

wordpress-stubs.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84252,6 +84252,7 @@ function add_menu_page($page_title, $menu_title, $capability, $menu_slug, $callb
8425284252
* @param callable $callback Optional. The function to be called to output the content for this page.
8425384253
* @param int|float $position Optional. The position in the menu order this item should appear.
8425484254
* @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required.
84255+
* @phpstan-param ''|callable $callback
8425584256
*/
8425684257
function add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null)
8425784258
{

0 commit comments

Comments
 (0)