• Resolved pochi555

    (@pochi555)


    Changed the display of the forum tab to only the owner in the UM settings.
    But anyone can view it.
    For the time being, is there a solution by describing it in functions.php etc.?

    Please see attached file.

    Regards,

    The page I need help with: [log in to see the link]

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Support Aswin Giri

    (@aswingiri)

    Hello @pochi555

    Is the tab still visible when not logged in as a user role other than administrator?

    Thread Starter pochi555

    (@pochi555)

    @aswingiri

    Thank you for your reply.

    Visible to all users regardless of whether they are logged in or not logged in.
    Also, Set to members only or Even if it is Only specific roles, it doesn’t seem to be reflected.

    Thread Starter pochi555

    (@pochi555)

    I am integrating wpforo with UM.

    Plugin Support Aswin Giri

    (@aswingiri)

    Hello @pochi555

    Have you added wpforo tab on UM profile? You can checkout following code snippets:

    add_filter( 'um_profile_tabs', function( $tabs ){
    
        if( isset( $tabs['forumwp']) ){
            $profile_id = um_profile_id();
            if( $profile_id != get_current_user_id()){
                unset( $tabs['forumwp'] );
            }
        }
    
        return $tabs;
    
    }, 1000 );

    The above code is made for forumWP but it works with anything if you are just trying to make a tab visible to the profile owner only. Please remember to replace ‘forumwp‘ with the tab id you would like to restrict.

    Thread Starter pochi555

    (@pochi555)

    @aswingiri

    Thank you for your reply.

    I wrote the following two in functions.php in the test.
    The comments tab is hidden (OK), but the forums (foro) tab is visible (NG).
    Please see attached file.
    https://d.kuku.lu/f5f33ff2d

    ————————–
    add_filter( ‘um_profile_tabs’, function( $tabs ){
    if( isset( $tabs[‘comments’]) ){
    $profile_id = um_profile_id();
    if( $profile_id != get_current_user_id()){
    unset( $tabs[‘comments’] );
    }
    }
    return $tabs;
    }, 1000 );

    add_filter( ‘um_profile_tabs’, function( $tabs ){
    if( isset( $tabs[‘foro’]) ){
    $profile_id = um_profile_id();
    if( $profile_id != get_current_user_id()){
    unset( $tabs[‘foro’] );
    }
    }
    return $tabs;
    }, 1000 );
    ————————–

    Regards,

    Plugin Support Aswin Giri

    (@aswingiri)

    @pochi555 Are you using any plugin to integrate foro with UM?

    Thread Starter pochi555

    (@pochi555)

    @aswingiri

    Thank you for your reply.

    It integrates with UM (Version 2.5.1) in the settings screen of wpforo (Version 2.0.9).
    Please see attached file.

    wpforo-setting
    https://d.kuku.lu/082b53c34

    plugins
    https://d.kuku.lu/3a7e4a2aa

    Regards,

    Thread Starter pochi555

    (@pochi555)

    @aswingiri

    wpforo-setteing2
    https://d.kuku.lu/661cd4a07

    Regards,

    Thread Starter pochi555

    (@pochi555)

    @aswingiri

    I have the following in my wpforo config.
    Please see attached file.

    wpForo – Boards – Turn WordPress to this forum board – Enabled

    https://d.kuku.lu/943c74246

    Plugin Support Aswin Giri

    (@aswingiri)

    @pochi555 Please try changing priority from 1000 to 9999. Something like below:

    add_filter( ‘um_profile_tabs’, function( $tabs ){
    if( isset( $tabs[‘foro’]) ){
    $profile_id = um_profile_id();
    if( $profile_id != get_current_user_id()){
    unset( $tabs[‘foro’] );
    }
    }
    return $tabs;
    }, 9999 );
    Thread Starter pochi555

    (@pochi555)

    @aswingiri

    However, this method also did not work properly.
    I will contact wpforo support.
    This matter will be closed for now.
    Thank you for your great support.

    @pochi555

    == Changelog ==

    = wpForo Forum 2.1.0 | 08.11.2022 =

    * Fixed Bug: Issue with Forum Tab in UM profile page

    Thread Starter pochi555

    (@pochi555)

    @missveronicatv
    Thank you for your reply and notice.

    @aswingiri
    This issue has been fixed in wpforo 2.1.0.
    Thank you for your great support.

    Regards,

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Changed the display of the forum tab to only the owner’ is closed to new replies.