Skip to content

Sub-Menus: outdated add_submenu_page() signature and a wrong add_options_page() parent slug #2555

Open
WordPress/developer-plugins-handbook
#85

Description

@dhrupo

Issue Description

The Add a Sub-Menu section shows an old signature for add_submenu_page(). It ends with callable $function = ''. The current core signature is:

add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = null )

The callback parameter is named $callback, and $position was added in WordPress 5.3 (@since 5.3.0 Added the $position parameter. in wp-admin/includes/plugin.php).

The Predefined Sub-Menus list also has two errors:

  • add_options_page() is listed twice, once with options-general.php and once with settings.php. add_options_page() always uses options-general.php. settings.php is the Network Admin parent, which already has its own line at the end of the list.
  • In the page source, the add_users_page() link starts with hhttps:// instead of https://. The rendered page on developer.wordpress.org shows a working link, but the Markdown source is wrong.

URL of the Page with the Issue

https://developer.wordpress.org/plugins/administration-menus/sub-menus/

Section of Page with the issue

Why is this a problem?

Developers do not learn about $position from this page, and the parameter name does not match the function reference. The duplicate add_options_page() line tells them the helper adds a page under settings.php, which it never does.

Suggested Fix

  • Signature: callable $function = '' → callable $callback = '', followed by int|float $position = null
  • Remove the add_options_page() – settings.php line
  • hhttps:// → https:// in the add_users_page() link

I have a PR ready for developer-plugins-handbook.

Activity

  1. github-actions commented on Nov 6, 2026

    @github-actions

    Heads up @WordPress/docs-issues-coordinators, we have a new issue open. Time to use 'em labels.

  2. added
    plugins
    on Nov 16, 2026
  3. github-actions commented on Nov 16, 2026

    @github-actions

    Heads up - the "plugins" label was applied to this issue.

  4. added
    developer documentation (DevHub)
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    developer documentation (DevHub)plugins

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions