Download

Documentation

Automatic redirect to Analytify dashboard when users log in

You would need to add following code in your theme's functions.php

 

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 );
DON’T MISS OUT!
Subscribe To Newsletter
Be the first to get latest updates and exclusive content straight to your email inbox.
Stay Updated
Give it a try, you can unsubscribe anytime.
close-link