删除“主页"并直接转到WooCommerce的“订单"在WordPress管理控制台上 [英] Remove "Home" and go direct to WooCommerce "Orders" on WordPress Admin dashboard

查看:52
本文介绍了删除“主页"并直接转到WooCommerce的“订单"在WordPress管理控制台上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用最新版本的WooCommerce,有一个主页"我无法使用任何内置设置删除的部分.

Using the most recent version of WooCommerce, there's a "Home" section that I cannot remove using any built in setting.

我设法删除了分析和营销选项,但是如何删除主页"选项,使它像以前一样-所有订单的概览?

I have managed to remove the analytics and marketing option, but how do I remove the "Home" option and that way, make it like it always was before -- an overview of all orders?

add_filter( 'woocommerce_admin_get_feature_config', 'remove_wc_marketing_menu_option', 10, 1 );
function remove_wc_marketing_menu_option($feature_config){   
$feature_config['marketing'] = false;
$feature_config['analytics'] = false;
return $feature_config;
}

推荐答案

您可以使用 remove_submenu_page

function action_admin_menu() {
    // Contains the URI of the current page.
    $current_url = $_SERVER['REQUEST_URI'];
    
    // Make sure wc-admin / customers page will still work
    if ( strpos( $current_url, 'customers' ) == false) {
        remove_submenu_page( 'woocommerce', 'wc-admin' );
    }
}
add_action( 'admin_menu', 'action_admin_menu', 99, 0 );


相关:


Related:

这篇关于删除“主页"并直接转到WooCommerce的“订单"在WordPress管理控制台上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆