Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter('bp_core_get_user_domain',function ($link,$author_id,$author_nicename){
- global $wp_rewrite;
- $auth_ID = (int) $author_id;
- $link = $wp_rewrite->get_author_permastruct();
- if ( empty( $link ) ) {
- $file = home_url( '/' );
- $link = $file . '?author=' . $auth_ID;
- } else {
- if ( '' === $author_nicename ) {
- $user = get_userdata( $author_id );
- if ( ! empty( $user->user_nicename ) ) {
- $author_nicename = $user->user_nicename;
- }
- }
- $link = str_replace( '%author%', $author_nicename, $link );
- $link = home_url( user_trailingslashit( $link ) );
- }
- // error_log($link);
- return $link;
- },9999999,3);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement