【问题标题】:Rename plugin name in Wordpress Dashboard Menu在 Wordpress 仪表板菜单中重命名插件名称
【发布时间】:2020-06-01 22:20:31
【问题描述】:

我在这里尝试了很多关于不同帖子的建议,但似乎没有一个对我有用。

我想在我的 Wordpress 网站的仪表板菜单上重命名插件的名称。插件名称为Sensei LMS,插件文件夹路径为/plugins/sensei-lms。

如果有人帮助我提供一些可用于重命名的代码,我将不胜感激。谢谢

【问题讨论】:

    标签: wordpress


    【解决方案1】:

    我以前用过this tutorial

    在你的情况下,它会是:

    function my_renamed_admin_menu_items() {
        global $menu;
    
        // Define your changes here
        $updates = array(
            "Sensei LMS" => array(
                'name' => 'New Menu Name'
            ),
            "Another Menu Name" => array(
                'name' => 'Another New Name'
            )
        );
    
        foreach ($menu as $k => $props) {
    
            // Check for new values
            $new_values = (isset($updates[$props[0]])) ? $updates[$props[0]] : false;
            if (!$new_values) continue;
    
            // Change menu name
            $menu[$k][0] = $new_values['name'];
        }
    }
    add_action('admin_init', 'my_renamed_admin_menu_items');
    

    【讨论】:

      猜你喜欢
      • 2014-09-29
      • 2019-03-10
      • 1970-01-01
      • 1970-01-01
      • 2020-06-12
      • 1970-01-01
      • 1970-01-01
      • 2021-02-13
      • 1970-01-01
      相关资源
      最近更新 更多