Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#56460 closed defect (bug) (duplicate)

Admin page screen id in other language

Reported by: zareidev's profile zareidev Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Menus Keywords:
Focuses: administration Cc:

Description

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
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

Change History (2)

#1 @zareidev
3 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #18857.

#2 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review deleted

Hi there, welcome to WordPress Trac! Thanks for the ticket.

Yes, it's the same issue as in #18857, let's continue the discussion there.

Note: See TracTickets for help on using tickets.