Download

Documentation

Print This page

Automatic redirect to Analytify dashboard when users log in

You would need to add the following code in your theme’s functions.php file

 

function analytify_dashboard_redirect( $redirect_to, $request, $user  ) {

  if ( ! is_wp_error( $user ) ) {

   return ( is_array( $user->roles ) && in_array( 'administrator', $user->roles ) ) ? admin_url( 'admin.php?page=analytify-dashboard' ) : $redirect_to;

  }

}

add_filter( 'login_redirect', 'analytify_dashboard_redirect', 10, 3 );
Last Call :  FLAT 40% Off on all Analytify plans.
Buy Analytify Now
close-image