WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#38814 closed defect (bug) (duplicate)

hook_suffix value varies based on user locale

Reported by: takayukister 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).

Change History (2)

#1 @swissspidy
4 years ago

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?

#2 @ocean90
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed
  • Version trunk deleted

Thanks for the report! We're already tracking this issue in #18857.

Note: See TracTickets for help on using tickets.