Hello,
Try this snippet to redirect to author page after login.
// Login redirect to specific url.
function _gd_snippet_login_redirect_to_author( $redirect_to, $requested_redirect_to, $user ) {
// Only modify the redirect once the user is logged in
if ( ! is_a( $user, 'WP_User' ) ) {
return $redirect_to;
}
// If a 'redirect_to' parameter has been passed that contains 'wp-admin'
if ( ! empty( $redirect_to ) && false !== strpos( $redirect_to, 'wp-admin' ) && user_can( $user, 'edit_posts' ) ) {
return $redirect_to;
}
$author_link = geodir_getlink( get_author_posts_url( $user->ID ), array( 'geodir_dashbord' => 'true' ), false );
$author_link = apply_filters( 'gd_dash_listing_author_link', $author_link, $user->ID );
$author_link = geodir_getlink( $author_link, array( 'stype' => 'gd_place' ), false );
$redirect_to = apply_filters( 'geodir_dashboard_link_my_listing', $author_link, 'gd_place', $user->ID );
return $redirect_to;
}
add_filter( 'login_redirect', '_gd_snippet_login_redirect_to_author', 100, 3 );
Kiran