This function takes a capability which will be used to determine whether or not a page is included in the menu. The function which is hooked in to handle the output of the page must check that the user has the required capability as well.
Parameters
$page_titlestring
The text to be displayed in the title tags of the page when the menu is selected.
$menu_titlestring
The text to be used for the menu.
$capabilitystring
The capability required for this menu to be displayed to the user.
$menu_slugstring
The slug name to refer to this menu by (should be unique for this menu).
$callbackcallableoptional
The function to be called to output the content for this page.Default: ''
$positionintoptional
The position in the menu order this item should appear.Default: null
Return
string|false
The resulting page's hook_suffix, or false if the user does not have the capability required.
Signature, return type and hooks compared across 5 parsed releases.
5.3.0
Added the $position parameter.from the docblock
2.0.0
Introduced.from the docblock
About this page
Parsed data
Generated from the wordpress-develop 6.9.7 tag, from src/wp-admin/includes/plugin.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.