Skip to main content

Wpdiscuz Integration

Has anyone succeded in integrating wpdiscuz and fluent community? What I want is the following:

Users are leaving comments on blog posts (and for me also learndash courses). Wpdiscuz directs the visitor to the users author page. Instead, I would like them to the commentators profile page in fluentcommunity.

I tried using this code:

add_filter('wpdiscuz_profile_url', function ($profile_url, $user) {
return home_url('/about/');
}, 999, 2);

Supposedly this should work - it was offered to me by wpdiscuz support in their forum but this doesn't work. I didn't added the code necessary to redirect to the profile page. I just for that of it want to be able I could alter the a href for the commentator.

Anyone succeded in doing so?

This will work:

add_filter("wpdiscuz_profile_url", function ($profile_url, $user) {
    if ($user && defined('FLUENT_COMMUNITY_PLUGIN_VERSION')) {
        $xProfile = \FluentCommunity\App\Models\XProfile::where('user_id', $user->ID)->first();
        if($xProfile) {
            $profile_url = $xProfile->getPermalink();
        }
    }
    return $profile_url;
}, 10, 2);

Assaf Manor

Shahjahan JewelΒ Thank you very much Shahjahan!

But it doesn't work... And the problem is not related to the fluent community part of the code. It redirects to the author page even if I just use a "dummy" redirect like

return home_url('/about/');

I think the problem is with the wpdiscuz hook and that's what I was asking about.

Assaf Manor

Shahjahan JewelΒ  Update - it works!

If anyone encounters a problem - go to wpDiscuz settings-> User Authorization and Profile Data -> and then just save. Only then did it work for me.