UsersWP for Client Dashboard

This topic contains 4 replies, has 3 voices, and was last updated by  Stiofan O’Connor 4 years, 5 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #5900

    Tony
    Expired Member
    Post count: 147

    Hi Stiofan and Paolo et al
    Are all user profiles visible to anyone or only if you show a user listings page?

    I’m trying to use userswp profile page as a dashboard for the user, and ideally its not visible to others.

    I believe I just need to restrict access to that page to the logged in user,
    is that correct? I don’t think I need a membership plugin for that, just a way to say profile only accessible by currenly logged in user or admins.

    Just to make sure the logged in user, and admins can see it.

    Any advice?

    #5902

    Alex Rollin
    Moderator
    Post count: 27815

    They are generally public, though tabs like like WPI Invoices are hidden from other users, only visible to the author.

    The following will hide the profiles for logged out users:

    
    
    
    add_action('template_redirect','_my_hide_uwp_profiles');
    function _my_hide_uwp_profiles(){
    	global $post;
    	if( !get_current_user_id() && is_uwp_profile_page()){
    		wp_die( 'You must be logged in to view user profiles.' );
    	}
    }
    

    We plan to add more options in the future around this idea but currently it would require a customization.

    #5903

    Tony
    Expired Member
    Post count: 147

    HI Alex!
    This led to a revelation. I’m building a business directory, but my client said, the employees of the businesses would want to have profiles!
    So you helped us have an epiphany.

    So, instead of hiding the whole profile, I’ll hide specific items that the user can see when he/she logs in.
    Like they can see their favorites, and I’m going to install a chat widget so users can can chat and create chat groups.

    So you actually created a solution!

    I’ll keep the code above, but I was thinking about it the wrong way!

    #5904

    Tony
    Expired Member
    Post count: 147

    If I could trouble you one more question in this thread
    If a user logs in and sees their profile, I want to show their favorites, and other widgets.

    BUT, I only want them to see their stuff in their profile. So if they go to another users profile, they will see whats public, but won’t see the things only the user themselves can see.

    For userswp fields, that’s apparent that you can set them to do that, but if I have other plugin widgets, is there a plugin you would recommend that I can set to say “only these items will appear on the profile when the current user is logged in”

    I think there are plugins that will hide content of any kind unless the current user is logged in and can see their data.

    Can you point me to any plugin you like or recommend that will work with userswp and wpgeodirectory?

    #5905

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    The latest release added this option to tabs, so you can add any content or shortcode to a tab and then hide it like that also.

    Thanks,

    Stiofan

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket