The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
link to the BuddyPr...
 
Share:
Notifications
Clear all

[Solved] link to the BuddyPress profile

6 Posts
2 Users
0 Reactions
1,504 Views
Posts: 4
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@tazar)
Active Member
Joined: 4 years ago
[#4257]

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: 8210
 Asti
Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@asti)
Illustrious Member
Joined: 8 years ago

Hi tazar,

You should use the wpdiscuz_user_settings_button hook for the customization. 


Posts: 4
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@tazar)
Active Member
Joined: 4 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: 8 years ago

Illustrious Member
Posts: 8210
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@tazar)
Active Member
Joined: 4 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: 8 years ago

Illustrious Member
Posts: 8210
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@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: