Viewing 1 replies (of 1 total)
  • Thread Starter dxbguy

    (@dxbguy)

    Ok nevermind, I just resolved this by adding this code to profiler.php

    if ($_GET["author"] || substr_count($_SERVER["REQUEST_URI"], "author")){
    	add_action('wp', 'pf_redirect');
    }
    
     	function pf_redirect(){
    		global $wpdb;
    
     		if ($_GET["author"]){
     			$user_name = $wpdb->get_var($wpdb->prepare("select user_login from " . $wpdb->prefix . "users where ID = %d limit 1", $_GET["author"]));
            }
            else if (substr_count($_SERVER["REQUEST_URI"], "author")){
            	if (substr($_SERVER["REQUEST_URI"], -1, 1) == "/"){
            		$uri = substr($_SERVER["REQUEST_URI"], 0, -1);
                }
                else {
                	$uri = $_SERVER["REQUEST_URI"];
                }
                $pos = strrpos($uri, "/");
            	$user_name = substr($uri, $pos + 1);
            }
    
     		$url = "/users?user=$user_name";
     		header("Location: $url");
     		exit();
     	}
Viewing 1 replies (of 1 total)
  • The topic ‘Link profiler with author’ is closed to new replies.