xlogus
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Plugins
In reply to: [WooCommerce] WooCommerce ovverides my dashboardThe solution is add previous code and give that user role capabilities for ‘manage_woocommerce’ and ‘edit_posts’
Forum: Plugins
In reply to: [WooCommerce] WooCommerce ovverides my dashboardHello
I have the same problem, the solution was add a function to change redirection but now isn`t working on last Woocomerce version
add_filter( 'woocommerce_login_redirect', 'wc_custom_user_redirectx'); function wc_custom_user_redirectx( $redirect, $user ) { // Get the first of all the roles assigned to the user $role = $user->roles[0]; $dashboard = admin_url(); $myaccount = get_permalink( wc_get_page_id( 'myaccount' ) ); if( $role == 'administrator' ) { //Redirect administrators to the dashboard $redirect = $dashboard; } elseif ( $role == 'shop-manager' ) { //Redirect shop managers to the dashboard $redirect = $dashboard; } elseif ( $role == 'editor' ) { //Redirect editors to the dashboard $redirect = $dashboard; } elseif ( $role == 'recepcionista' ) { //Redirect authors to the dashboard $redirect = $dashboard; } elseif ( $role == 'customer' || $role == 'subscriber' ) { //Redirect customers and subscribers to the "My Account" page $redirect = $myaccount; } else { //Redirect any other role to the previous visited page or, if not available, to the home $redirect = wp_get_referer() ? wp_get_referer() : home_url(); } return $redirect; }
I solved the problem using this plugin https://gist.github.com/brasofilo/4570587/download#
I have the same problem with WP4 also tried reparing posts table or installing a media grid plugin but problem persists
Viewing 4 replies - 1 through 4 (of 4 total)