Support & Downloads

Quisque actraqum nunc no dolor sit ametaugue dolor. Lorem ipsum dolor sit amet, consyect etur adipiscing elit.

s f

Contact Info
198 West 21th Street, Suite 721
New York, NY 10010
[email protected]
+88 (0) 101 0000 000
Follow Us

חלב ודבש בניית אתרי אינטרנט

וורדפרס הפניית משתמש לעמוד הפרופיל שלו לאחר כניסה לניהול – WordPress Redirect user to his/her own author page after login

WordPress Redirect user to his/her own author page after login

פונקציה פשוטה שעושה את העבודה. יש להעתיק את הפונקציה לתוך קובץ functions.php

/*Aggiunge un filtro per reindirizzare l'URL login*/
add_filter("login_redirect","gangmei_redirect_to_profile",100,3);
 
function gangmei_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user)
{
/*if no redirect was specified,let us think ,user wants to be in wp-dashboard*/
if(empty($redirect_to_calculated))
    $redirect_to_calculated=admin_url();
 
    /*if the user is not site admin,redirect to his/her profile*/
    if(!is_admin($user->user_login))
        return get_author_posts_url($user->ID,$curauth->user_login);
 
    else
        return $redirect_to_calculated; /*if site admin or not logged in,do not do anything much*/
 
}