Here i create the pages:

add_action("admin_menu", "wpa_create_plugin_pages");
function wpa_create_plugin_pages() {
    //Add submenu to Users
    $wpa_profile = "wpa_user_profile_settings";//parent slug

    $wpa_user_meta = get_user_meta(get_current_user_id());//don't mind this
    $wpa_role = $wpa_user_meta["wpa_toto_role"][0];//don't mind this

    //add_menu_page("אזור אישי", "אזור אישי", "read", $wpa_profile, "wpa_user_de", 'dashicons-admin-users');

    add_menu_page("משתמשים", "משתמשים", "read", $wpa_profile, "wpa_user_de", 'dashicons-admin-users');// the parent

    add_submenu_page($wpa_profile, "ערוך פרופיל אישי", "ערוך פרופיל אישי", "read", "wpa_edit_my_profile", "wpa_edit_my_profile");//children

    add_submenu_page($wpa_profile, "רשימת משתמשים", "רשימת משתמשים", "read", "wpa_user_list", "wpa_users_list");//children

    add_submenu_page($wpa_profile, "צור משתמש", "צור משתמש", "read", "wpa_user_profile", "wpa_user_profile");//children

    add_submenu_page($wpa_profile, "שלח נקודות", "שלח נקודות", "read", "wpa_user_send_points", "wpa_user_send_points");//children

    add_submenu_page($wpa_profile, "הוסף נקודות", "הוסף נקודות", "read", "wpa_create_points", "wpa_admin_create_points");//children

i used with get_current_screen() to output this data. enter image description here

and here the issue: enter image description here

as you can see inside WP_Screen Object the base and the id are %d7%9e%d7%a9%d7%aa%d7%9e%d7%a9%d7%99%d7%9d_page_wpa_user_list...

%d7%9e%d7%a9%d7%aa%d7%9e%d7%a9%d7%99%d7%9d = משתמשים(users in hebrew), it's url encodes the title of the parent page.

even the body class has -d7-9e-d7-a9-d7-aa-d7-9e-d7-a9-d7-99-d7-9d_page_wpa_user_list. can i put a custom prefix for submenu page?

  • What if you invert the logic? Like using latin characters for add_menu/submenu and translate it to Hebrew wherever needed – brasofilo Aug 24 '18 at 0:03
  • Hello, maybe there is some filter hook that can help me with that? – Kefka Sep 20 '18 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.