Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#16238 closed defect (bug) (fixed)

convert_to_screen() doesn't support network/user admin

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

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 13 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 13 years ago.
Respect existing dashboard suffixes
16238.3.diff (684 bytes) - added by nacin 13 years ago.

Download all attachments as: .zip

Change History (11)

@kawauso
13 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
13 years ago

  • Keywords has-patch added

#2 @nacin
13 years ago

  • Milestone changed from Awaiting Review to 3.1

Looks good.

#3 @ryan
13 years ago

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

@kawauso
13 years ago

Respect existing dashboard suffixes

#4 @kawauso
13 years ago

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

@nacin
13 years ago

#5 @kawauso
13 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
13 years ago

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

#7 @markjaquith
13 years ago

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

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

#8 @ocean90
13 years ago

Related: #16348

Note: See TracTickets for help on using tickets.