Make WordPress Core

Opened 12 years ago

Closed 9 years ago

#23108 closed enhancement (fixed)

Deprecate add_object_page() and add_utility_page()

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: swissspidy's profile swissspidy
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Administration Keywords: has-patch commit
Focuses: Cc:


add_object_page() and add_utility_page() are not used in core and are just wrappers which pass $_wp_last_object_menu++ and $_wp_last_utility_menu++, respectively, to add_menu_page().

This can lead to a conflict with other menu items added by plugins, see #23095.

Attachments (3)

23108.patch (5.7 KB) - added by SergeyBiryukov 12 years ago.
23108.2.patch (5.8 KB) - added by ocean90 12 years ago.
23108.3.patch (6.1 KB) - added by swissspidy 9 years ago.

Download all attachments as: .zip

Change History (16)

#2 @SergeyBiryukov
12 years ago

  • Keywords has-patch added

#4 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.6

#5 @chriscct7
12 years ago

  • Cc chriscct7@… added


#6 @mordauk
12 years ago

  • Cc pippin@… added

12 years ago

#7 @ocean90
12 years ago

23108.2.patch adds the _deprecated_function() calls.

#8 @ryan
11 years ago

  • Milestone changed from 3.6 to Future Release

#9 @jamesgol
9 years ago

Just ran into an issue with a plugin using add_object_page on too many items and overwriting other entries. Searched for an issue and ended up here.

I'd agree this should be deprecated but for the time being why not just ditch the whole $_wp_last_object_menu++; in add_object_page and have it pass null to add_menu_page?

9 years ago

#10 @swissspidy
9 years ago

  • Milestone changed from Future Release to 4.5

#11 @ocean90
9 years ago

  • Keywords commit added

#12 @swissspidy
9 years ago

  • Owner set to swissspidy
  • Status changed from new to assigned

#13 @swissspidy
9 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35874:

Admin Menu: Deprecate add_object_page() and add_utility_page().

These functions are not used in core and are just wrappers for add_menu_page().

Fixes #23108.

Note: See TracTickets for help on using tickets.