Make WordPress Core

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#16238 closed defect (bug) (fixed)

convert_to_screen() doesn't support network/user admin

Reported by: kawauso Owned by:
Priority: normal Milestone: 3.1
Component: Administration Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

The new Network and User dashboards use the -network and -user slugs respectively in the screen ID.

When using add_contextual_help() in the context of a plugin, developers are likely to be using the string result of add_submenu_page(). This is passed to convert_to_screen() and is always treated as having no specific context, resulting in the contextual help not being displayed outside of the standard dashboard. The same is likely to apply for other uses of convert_to_screen().

Attachments (3)

16238.diff​ (615 bytes ) - added by kawauso 16 years ago.
Assume current dashboard as context (since the dashboards have individual menu hooks, plugins shouldn't be trying to add menus of context)
16238.2.diff​ (706 bytes ) - added by kawauso 16 years ago.
Respect existing dashboard suffixes
16238.3.diff​ (684 bytes ) - added by nacin 16 years ago.

Download all attachments as: .zip

Change History (11)

@kawauso
16 years ago

Assume current dashboard as context (since the dashboards have individual menu hooks, plugins shouldn't be trying to add menus of context)

#1 @kawauso
16 years ago

  • Keywords has-patch added

#2 @nacin
16 years ago

  • Milestone Awaiting Review → 3.1

Looks good.

#3 @ryan
16 years ago

Let's make sure we don't end up with -network-network if the passed string is already suffixed.

@kawauso
16 years ago

Respect existing dashboard suffixes

#4 @kawauso
16 years ago

New patch to respect existing suffixes passed. More flexible than just stripping them out in the str_replace().

@nacin
16 years ago

#5 @kawauso
16 years ago

nacin: Looked at that method, but it can result in a slug such as myplugin-user-network, which would work for purposes of preventing loads on the wrong page, but would be an invalid id slug.

#6 @nacin
16 years ago

Suggest commit on 16238.diff​ (after talking with ryan).

#7 @markjaquith
16 years ago

  • Resolution → fixed
  • Status new → closed

(In [17318]) Append -network or -user suffix in convert_to_screen(). props kawauso. fixes #16238

#8 @ocean90
16 years ago

Related: #16348

Note: See TracTickets for help on using tickets.