Opened 16 years ago
Closed 15 years ago
#9438 closed defect (bug) (fixed)
Some Hook names are localized and therefore rendered useless
Reported by: | hakre | Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | high |
Severity: | blocker | Version: | 2.7.1 |
Component: | Administration | Keywords: | has-patch tested commit |
Focuses: | Cc: |
Description
Some Hook Names are localized. For Example the string "settings" will be translated to "einstellungen". Something goes horribly wrong because of that, Hook Names are not consistent when WordPress is beding localized (which is normal).
The HookName I stumbeled over:
"einstellungen_page_breadcrumb-navxt"
This seems to be related with registering Submenu Pages.
Attachments (3)
Change History (18)
#2
@
16 years ago
- Keywords has-patch added
- Summary changed from Some Hook names are localized by accident to Some Hook names are localized and therefore rendered useless
#3
@
16 years ago
Hookname before patch: "einstellungen_page_breadcrumb-navxt"
Hookname after patch: "options-general_page_breadcrumb-navxt"
that is a german localized wordpress, this is a admin_page_hook in the breadcrumb plugin.
#4
@
16 years ago
Hookname before patch: "einstellungen_page_breadcrumb-navxt"
Hookname after patch: "options-general_page_breadcrumb-navxt"
that is a german localized wordpress, this is a admin_page_hook in the breadcrumb plugin.
#7
@
15 years ago
I seem to recall some plugins breaking last time we tried to fix this, but I am not certain. I tested this with my usual menu testing plugins and all was well, so let's try this out for 2.8 and be wary of reports of plugins breaking.
#9
@
15 years ago
thank you so much... this was *sooooo* annoying, because it rendered those functions essentially useless. :-)
#10
@
15 years ago
- Resolution fixed deleted
- Severity changed from critical to blocker
- Status changed from closed to reopened
original patch breaks a few plugins. fix attached
I could dig in a bit more. This falls on my feet again. This makes the development of a Plugin Page complicated since you can not gain knowlege about the name of the hook in development.
this is where the localized name is coming from (global array):
$admin_page_hooks[$parent]
this is in get_plugin_page_hookname() in wp-admin/includes/plugin.php
this array is filed off from the menu array which is defined in wp-admin/menu.php
the solution is quite easy. there only needs a little fix in assigning the name there. instead of taking a localized string, I suggest to take the name of the actual php file, the extension removed.