WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 months ago

#13266 new defect (bug)

Admin page hooks change when plugin is translated (tied to $menu_title)

Reported by: uglyrobot Owned by: westi
Milestone: Future Release Priority: normal
Severity: major Version: 3.0
Component: Plugins Keywords: has-patch needs-testing
Focuses: administration Cc:

Description

WP3 is using the title of the parent menu item in a menu block to fire the load-hooks for the lesser menu items? Lost me? Ok an example -

Plugin Membership has this menu structure (simplified)

Membership – main heading
Membership – Top inner
Edit Member – inner
Edit Levels – inner
Edit Subs – inner
etc…

The page load hooks for the non-translated plugin are as follows:
Membership – load-toplevel_page_membership
Membership – load-toplevel_page_membership
Edit Member – load-membership_page_members
Edit Levels – load-membership_page_membershiplevels
Edit Subs – load-membership_page_membershipsubs
etc…

Now, if I use a language translation on the plugin, which for the sake of clarity here, translates the word Membership to Aaargh the page load hooks become.
Membership – load-toplevel_page_membership
Membership – load-toplevel_page_membership
Edit Member – load-aaargh_page_members
Edit Levels – load-aaargh_page_membershiplevels
Edit Subs – load-aaargh_page_membershipsubs
etc…

Thus any actions you are running on the inner pages aren’t called.

Attachments (1)

admin-page-hooks.diff (396 bytes) - added by uglyrobot 4 years ago.
This should pull from the slug rather than translated title

Download all attachments as: .zip

Change History (6)

uglyrobot4 years ago

This should pull from the slug rather than translated title

comment:1 ryan4 years ago

  • Milestone changed from 3.0 to 3.1

This has been a problem forever. We can look at this for 3.1. Too late for 3.0.

comment:2 hakre4 years ago

3.1 on shedule now. Too late again?

comment:3 nacin3 years ago

  • Milestone changed from Awaiting Triage to Future Release
  • Priority changed from high to normal

Need to be back compat here.

comment:4 nacin3 months ago

  • Component changed from Plugins to Admin APIs
  • Focuses administration added

comment:5 nacin3 months ago

  • Component changed from Admin APIs to Plugins

Sorry for the noise.

Note: See TracTickets for help on using tickets.