【问题标题】:Move submenu in Wordpress Admin在 Wordpress Admin 中移动子菜单
【发布时间】:2012-04-21 18:57:33
【问题描述】:

我刚刚使用 add_menu_page 在我的 Wordpress 管理员中创建了一个自定义菜单,如何在这个新的顶级菜单下移动已经存在的子菜单(例如外观 > 标题)?

【问题讨论】:

    标签: wordpress submenu


    【解决方案1】:

    经过一番研究,我发现您可以调用全局 $submenu。使用此变量,您可以像这样移动已经存在的子菜单:

    global $submenu
    
    foreach ($submenu['index.php'] as $key => $subItem) {
        if ($subItem[2] === 'update-core.php') {
            $submenu['options-general.php'][0.1] = $subItem;
    
            ksort($submenu['options-general.php']);
        }
    }
    unset($submenu['index.php'][$key];
    

    我还没有弄清楚的一件事是如何让 wp 管理员识别父级的更改(也就是当我在这个子菜单页面上时子菜单没有展开)。

    希望为这个答案找到一些改进。

    【讨论】:

      【解决方案2】:
      For adding submenu to main menu.Follow the below steps:
      
      
      1. Go to Appearance->Menus.In Menus window,on right hand side,you will see the added 
         menus list.Just move the mouse over the menu name which you want to be the sub menu,an 
         hand symbol will come,then just drag and move the menu little bit to the right side 
         below the main menu to which you want this menu to be the sub menu.   
      

      【讨论】:

      • 我认为您没有阅读过这个问题。他在问如何编辑 wp-admin 菜单。不是前端的菜单
      猜你喜欢
      • 2021-08-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-16
      • 2023-04-07
      • 1970-01-01
      • 2017-04-29
      • 1970-01-01
      相关资源
      最近更新 更多