WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 2 years ago

#30540 closed defect (bug) (fixed)

Docblock for wp_get_nav_menu_to_edit in /wp-admin/includes/nav-menu.php incorrectly declares $menu_id param as string

Reported by: dustyf Owned by: DrewAPicture
Milestone: 4.1 Priority: normal
Severity: normal Version:
Component: Menus Keywords: has-patch
Focuses: docs Cc:

Description

The $menu_id param in wp_get_nav_menu_to_edit in file, /wp-admin/includes/nav-menu.php, should be declared as an int instead of a string. The parameter is declaring an ID of a specific menu that will be edited.

Attachments (2)

30540.patch (465 bytes) - added by jaimieolmstead 2 years ago.
param changed from string to int
30540.2.patch (547 bytes) - added by DrewAPicture 2 years ago.

Download all attachments as: .zip

Change History (6)

@jaimieolmstead
2 years ago

param changed from string to int

#1 @dustyf
2 years ago

  • Keywords has-patch added

#2 @DrewAPicture
2 years ago

  • Milestone changed from Awaiting Review to 4.1
  • Version trunk deleted

Hi Jaimie, thanks for the patch!

Last edited 2 years ago by DrewAPicture (previous) (diff)

#3 @DrewAPicture
2 years ago

Hi Jaimie,

Just two things to note for future reference that I've adjusted in 30540.2.patch:

  • The parameter is optional so we need to mark it as such with the default value
  • Patches should be generated from the project root directory
Last edited 2 years ago by DrewAPicture (previous) (diff)

#4 @DrewAPicture
2 years ago

  • Owner set to DrewAPicture
  • Resolution set to fixed
  • Status changed from new to closed

In 30627:

Use the correct type (integer) for the $menu_id parameter in the wp_get_nav_menu_to_edit() DocBlock.

Also properly mark the parameter as optional and specify the default value.

Props jaimieolmstead for the initial patch.
Fixes #30540.

Note: See TracTickets for help on using tickets.