diff --git a/functionMap.php b/functionMap.php index 5ae0f58..d72048d 100644 --- a/functionMap.php +++ b/functionMap.php @@ -39,7 +39,19 @@ '_get_list_table' => ["(\$class_name is 'WP_Posts_List_Table'|'WP_Media_List_Table'|'WP_Terms_List_Table'|'WP_Users_List_Table'|'WP_Comments_List_Table'|'WP_Post_Comments_List_Table'|'WP_Links_List_Table'|'WP_Plugin_Install_List_Table'|'WP_Themes_List_Table'|'WP_Theme_Install_List_Table'|'WP_Plugins_List_Table'|'WP_Application_Passwords_List_Table'|'WP_MS_Sites_List_Table'|'WP_MS_Users_List_Table'|'WP_MS_Themes_List_Table'|'WP_Privacy_Data_Export_Requests_List_Table'|'WP_Privacy_Data_Removal_Requests_List_Table' ? new : false)", '@phpstan-template T' => 'of string', 'class_name' => 'T', 'args' => 'array{screen?: string}'], 'absint' => ['($maybeint is T&int<0, max> ? T : ($maybeint is int ? int<1, max> : ($maybeint is empty ? 0 : ($maybeint is numeric-string ? int<0, max> : ($maybeint is string ? 0 : ($maybeint is true|non-empty-array ? 1 : ($maybeint is bool ? 0|1 : int<0, max>)))))))', '@phpstan-template T' => 'of int', 'maybeint' => 'T|scalar|array|resource|null'], 'addslashes_gpc' => ['T', '@phpstan-template' => 'T', 'gpc' => 'T'], + 'add_menu_page' => [null, 'callback' => "''|callable"], + 'add_links_page' => [null, 'callback' => "''|callable"], + 'add_media_page' => [null, 'callback' => "''|callable"], + 'add_pages_page' => [null, 'callback' => "''|callable"], + 'add_posts_page' => [null, 'callback' => "''|callable"], + 'add_theme_page' => [null, 'callback' => "''|callable"], + 'add_users_page' => [null, 'callback' => "''|callable"], + 'add_options_page' => [null, 'callback' => "''|callable"], + 'add_plugins_page' => [null, 'callback' => "''|callable"], 'add_submenu_page' => [null, 'callback' => "''|callable"], + 'add_comments_page' => [null, 'callback' => "''|callable"], + 'add_dashboard_page' => [null, 'callback' => "''|callable"], + 'add_management_page' => [null, 'callback' => "''|callable"], 'bool_from_yn' => ["(\$yn is 'y' ? true : false)"], 'have_posts' => [null, '@phpstan-impure' => ''], 'is_new_day' => ['0|1'], diff --git a/wordpress-stubs.php b/wordpress-stubs.php index 39522cf..fac7ccb 100644 --- a/wordpress-stubs.php +++ b/wordpress-stubs.php @@ -87838,6 +87838,7 @@ function uninstall_plugin($plugin) * * Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS. * @param int|float $position Optional. The position in the menu order this item should appear. * @return string The resulting page's hook_suffix. + * @phpstan-param ''|callable $callback */ function add_menu_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '', $position = \null) { @@ -87897,6 +87898,7 @@ function add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $ * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_management_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -87920,6 +87922,7 @@ function add_management_page($page_title, $menu_title, $capability, $menu_slug, * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_options_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -87943,6 +87946,7 @@ function add_options_page($page_title, $menu_title, $capability, $menu_slug, $ca * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_theme_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -87966,6 +87970,7 @@ function add_theme_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_plugins_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -87989,6 +87994,7 @@ function add_plugins_page($page_title, $menu_title, $capability, $menu_slug, $ca * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_users_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88012,6 +88018,7 @@ function add_users_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_dashboard_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88035,6 +88042,7 @@ function add_dashboard_page($page_title, $menu_title, $capability, $menu_slug, $ * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_posts_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88058,6 +88066,7 @@ function add_posts_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_media_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88081,6 +88090,7 @@ function add_media_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_links_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88104,6 +88114,7 @@ function add_links_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_pages_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) { @@ -88127,6 +88138,7 @@ function add_pages_page($page_title, $menu_title, $capability, $menu_slug, $call * @param callable $callback Optional. The function to be called to output the content for this page. * @param int $position Optional. The position in the menu order this item should appear. * @return string|false The resulting page's hook_suffix, or false if the user does not have the capability required. + * @phpstan-param ''|callable $callback */ function add_comments_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \null) {