Code-Snippets-Functions/Execute a function on a child site/WooCommerce/remove-home-and-go-direct-to-orders-instead-in-wp-admin.txt

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 );