[wp-trac] [WordPress Trac] #56460: Admin page screen id in other language
WordPress Trac
noreply at wordpress.org
Tue Aug 30 06:24:37 UTC 2022
#56460: Admin page screen id in other language
----------------------------+-----------------------------
Reporter: zareidev | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Menus | Version:
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
Hi,
When I use `add_menu_page` in a plugin, the screen id would be a
menu_title (second parameter of `add_menu_page`). but we always pass
menu_title with a `__` function for translation.
for example:
{{{#!php
<?php
add_menu_page(
__( 'Videos', 'vod' ),
__( 'Videos', 'vod'), // The problem is with this
'manage_options',
'vod' . '-videos',
[$this, 'video_library_page'],
VOD_PLUGIN_ROOT_URL . 'assets/images/logo.svg',
10
);
add_submenu_page(
'vod' . '-videos',
__( 'Upload New Video', 'vod' ),
__( 'Add', 'vod' ),
'manage_options',
'vod' . '-videos-add',
[$this, 'add_video_page'],
);
}}}
In this situation when the admin dashboard is English everything is fine
as below:
URL: /wp-admin/admin.php?page=vod-videos-add
Screen id: videos_page-vod-videos-add
but on the Persian Dashboard:
URL: /wp-admin/admin.php?page=vod-videos-add
Screen id: %d9%88%db%8c%d8%af%d8%a6%d9%88%d9%87%d8%a7_page-vod-videos-add
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56460>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list