Created
May 11, 2021 10:37
-
-
Save jjmontalban/f96ee82b7d0ee62079f170bee9d44c1c to your computer and use it in GitHub Desktop.
Redirigir a pedidos desde el principal del dashboard de /mi-cuenta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @snippet redirigir a pedidos desde el principal del dashboard de /mi-cuenta | |
* @author https://rudrastyh.com/woocommerce/remove-dashboard-from-my-account-menu.html#redirect-to-orders | |
*/ | |
add_action('template_redirect', 'redirect_to_orders_from_dashboard' ); | |
function redirect_to_orders_from_dashboard(){ | |
if( is_account_page() && empty( WC()->query->get_current_endpoint() ) ){ | |
wp_safe_redirect( wc_get_account_endpoint_url( 'orders' ) ); | |
exit; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment