Skip to content

Instantly share code, notes, and snippets.

@deeman
Last active February 26, 2019 00:27
Show Gist options
  • Select an option

  • Save deeman/d31ba4360533dca7f32634af81253069 to your computer and use it in GitHub Desktop.

Select an option

Save deeman/d31ba4360533dca7f32634af81253069 to your computer and use it in GitHub Desktop.
Admin Login to WooCommerce Product-area
// 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