The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
link to the BuddyPr...
 
Share:
Notifications
Clear all

[Solved] link to the BuddyPress profile

6 Posts
2 Users
0 Reactions
973 Views
Posts: 4
Topic starter
(@tazar)
Active Member
Joined: 2 years ago

Hi

I'm using the BuddyPress integration addon. I have 'Link "My Content and Settings" Button to Profile Discussions Tab.' enabled. 

I want when someone clicks on a comment author name to be redirected to their BuddyPress profile. Now, it just opens up the WPDiscuzz popup.

What settings do I need to do for what I said above?

 

5 Replies
Asti
Posts: 7617
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

Hi tazar,

You should use the wpdiscuz_user_settings_button hook for the customization. 

Posts: 4
Topic starter
(@tazar)
Active Member
Joined: 2 years ago

Could you please give me an example of how I can use that function? I can only copy&paste code, but don't know WordPress programming 🙁

I also thought that clicking on someone's name should have redirect automatically to their BuddyPress profile instead of the default WPDiscuzz popup window. Or that is not so?

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

Illustrious Member
Posts: 7617

@tazar,

This code should work fine:

if (!function_exists('custom_url')) {
    add_filter("wpdiscuz_user_settings_button", "custom_url", 10, 3);

    function custom_url($html, $currentUser, $currentUserEmail) {
        if (!empty($currentUser->ID)) {
            $user_url = function_exists('bp_core_get_user_domain') ? bp_core_get_user_domain($currentUser->ID) : '';
            if ($user_url) {
                $wpdiscuz = wpDiscuz();
                $html = "<div class='wpdiscuz-user-settings  wpd-not-clicked' wpd-tooltip='" . esc_attr($wpdiscuz->options->getPhrase("wc_content_and_settings")) . "'  wpd-tooltip-position='right'><a href='$user_url'><i class='fas fa-user-cog'></i></a></div>";
            }
        }
        return $html;
    }
}

 

Put it in the active theme functions.php file. 

This article helps to add a custom code to your website: How to Easily Add Custom Code in WordPress (without Breaking Your Site)

Posts: 4
Topic starter
(@tazar)
Active Member
Joined: 2 years ago

Thank you very much. That works! For sure, I could not write this code snippet myself :))

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

Illustrious Member
Posts: 7617

@tazar,

We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

Share: