The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
feature error: Use ...
 
Share:
Notifications
Clear all

[Solved] feature error: Use Website URL as Profile URL

11 Posts
3 Users
2 Reactions
1,451 Views
Posts: 4
Topic starter
(@tienthangtn)
New Member
Joined: 3 years ago

I can't use your "Use Website URL as Profile URL" feature. It only shows the author's article detail page. I have updated the link in the profile page. I have tried the 2 supported code snippets in the 2 articles:

https://wpdiscuz.com/docs/codex/filters/wpdiscuz_profile_url/

and https://wpdiscuz.com/community/troubleshooting/profile-url-not-working-for-all-users/#post-5592

It still can't work.

Please help me

10 Replies
Asti
Posts: 7661
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

Hi tienthangtn,

The option "Use Website URL as Profile URL" works only if you fill the URL in the "Website" field. 

image
6 Replies
(@tienthangtn)
Joined: 3 years ago

New Member
Posts: 4

@asti oh no. I mean is url of admin, not guest. I checked Use Website URL as Profile URL and put admin url website but it still show link, only show link author page

Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7661

@tienthangtn,

 I mean is url of admin, not guest. I checked Use Website URL as Profile URL and put admin url website but it still show link, only show link author page

I understand our question. I've just explained how the option works. Everything is correct with the option. It works fine. As I've already mentioned, this option works only from the frontend. I.e, if user fill the URL on the Website field. 

It doesn't have any relation to the dashboard user's website sections. Those are being saved on different Database tables. That's why it doesn't work in your case. 

I'm going to ask developers if there is any solution we can help you. I'll update this topic once I've received any news for you. 

Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7661

@tienthangtn,

You can use the following hook code:

add_filter("wpdiscuz_profile_url", function ($profile_url, $user) {
    if (!empty($user->ID)) {
        if (in_array('administrator', $user->roles)) {
            $profile_url = get_home_url();
      }
   }
    return $profile_url;
}, 999, 2);

Put it in the active theme functions.php file. 

(@tienthangtn)
Joined: 3 years ago

New Member
Posts: 4

@asti I read this tutorial in another post. I have tried but no success. thank for your help

Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7661

@tienthangtn,

This is a new code not the one provided in previous post. 

(@tienthangtn)
Joined: 3 years ago

New Member
Posts: 4

@asti I just tried it and it still doesn't work

Posts: 4
(@gitarrenbog)
Active Member
Joined: 7 months ago

Hello,

I know this post is a bit older, but I've encountered the same problem and can't solve it with the above code either.

I would like the link to lead to the user's homepage as it is entered in the user administration. The code above sends me to the author's page.

It would be great if someone could give me a hand.

Thanks and best regards

Posts: 4
(@gitarrenbog)
Active Member
Joined: 7 months ago

If anyone is still looking ... I think I've found a solution. At least it works on my website.

 

add_filter("wpdiscuz_profile_url", function ($profile_url, $user) {
if (!empty($user->ID)) {
$profile_url = get_the_author_meta("user_url", $user->ID);
}
return $profile_url;
}, 999, 2);

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7661

@gitarrenbog,

Thank you for taking the time to share the solution. We really appreciate it.

Share: