Last active
February 26, 2019 00:27
-
-
Save deeman/d31ba4360533dca7f32634af81253069 to your computer and use it in GitHub Desktop.
Admin Login to WooCommerce Product-area
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
| // Login direct to the Product area in Admin Back-end | |
| add_action( 'load-index.php', 'woo_direct_access_wp_dashboard_redirect' ); | |
| function woo_direct_access_wp_dashboard_redirect(){ | |
| wp_redirect( admin_url( 'edit.php?post_type=product' ) ); | |
| } | |
| add_filter( 'login_redirect', 'woo_login_wp_dashboard_redirect', 9999, 3 ); | |
| function woo_login_wp_dashboard_redirect( $redirect_to, $request, $user ){ | |
| $redirect_to = admin_url( 'edit.php?post_type=product' ); | |
| return $redirect_to; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment