Opened 9 years ago
Closed 9 years ago
#38814 closed defect (bug) (duplicate)
hook_suffix value varies based on user locale
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | |
| Component: | Administration | Keywords: | |
| Focuses: | Cc: |
Description
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/plugin.php?rev=38687#L1079
In add_menu_page(), $admin_page_hooks[$menu_slug] is assigned with sanitized $menu_title. This $menu_title is in most cases a translated string with __().
$admin_page_hooks value is in turn used in get_plugin_page_hookname(), which determines the value of $page_hook and $hook_suffix in wp-admin/admin.php.
As a result, the $hook_suffix value on the same page can vary based on the current user's locale setting.
For example, on a submenu page of my Contact Form 7 plugin (wp-admin/admin.php?page=wpcf7-integration), the $hook_suffix value is contact_page_wpcf7-integration when the user locale is en_US, but it changes to %e3%81%8a%e5%95%8f%e3%81%84%e5%90%88%e3%82%8f%e3%81%9b_page_wpcf7-integration when the user locale is ja (Japanese).
Wouldn't the same happen in WordPress 4.6 when the site locale is changed?