Support » Plugin: Author Avatars List/Block » multisite – change user link

Viewing 3 replies - 1 through 3 (of 3 total)
  • upvote!

    Plugin Author Paul Bearne

    (@pbearne)

    Hi Guys

    I call into WP to the get_author_posts_url function to get the URL for the authors page. It has this fliter that you can use to adjusted the path

    /**
    * Filters the URL to the author's page.
    *
    * @since 2.1.0
    *
    * @param string $link            The URL to the author's page.
    * @param int    $author_id       The author's id.
    * @param string $author_nicename The author's nice name.
    */
    $link = apply_filters( 'author_link', $link, $author_id, $author_nicename );

    so you can change the path using code like this

    add_filter( 'author_link', 'author_link'  );
    
    function author_link( $link ){
    
    	$link = str_replace( '/blog/author/', '/vendor/', $link );
    	return $link;
    }
    Thread Starter jevorby

    (@jevorby)

    Thanks Paul! I decided to use another plugin to show users. However, I’ll save the code snippet. Maybe use another way another time.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘multisite – change user link’ is closed to new replies.