mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://stackoverflow.com/questions/64610440/remove-home-and-go-direct-to-orders-instead-in-wp-admin-for-woocommerce
10 lines
363 B
Text
10 lines
363 B
Text
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 );
|