• Resolved louiskorver1985

    (@louiskorver1985)


    Hello,

    I started a new website: http://www.wdkaprikbord.nl its a bulletin board for people in my school to post messages. The reason i created this website is that in my school (Art Academy) all the message boards are spread out over the school and there is no central place to share our expertise. So i want to help the school and my fellow students to make easier contact with each other.

    I am already pretty far with the website and for a non coder i am pretty happy with it. But there is of course a problem otherwise i wouldn’t post it here :).

    When people make a post they need to fill in a contact custom form (created by WP user frontend). Where they can put their email and phone number or any other sort of contact information. I think this contact information needs to be protected from not logged in users.

    I am not a good coder. So i was wondering how i can hide the information people fill in to this custom (contact) form for users that are not logged in. So my fellow students feel safe posting their contact information.

    Or is there maybe a better solution to this safety issue.

    Summary:
    I want people to see the content of the site when not logged in except the contact information of all the authors.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You can enclose the code that outputs the contact information in the is_user_logged_in() function.

    The exact place for the code depends on how/where the contact info is displayed. If you can put the code into a pastebin, someone may be able to help more.

    Thread Starter louiskorver1985

    (@louiskorver1985)

    Hey there,

    Its a form i created by WP user frontend. You can add extra custom menu’s.

    http://pastebin.com/UkYyfHeu

    I think this is the output for the custom field(named contact) of the WP user frontend form.

    Any ideas?

    I believe that you can get what you want by changing this:

    if ( $show_custom != 'on' ) {
       return $content;
    }

    to this:

    if ( $show_custom != 'on' ) {
       return $content;
    }
    if ( ! is_user_logged_in() ) {
       return $content;
    }
    Thread Starter louiskorver1985

    (@louiskorver1985)

    You are awesome! Thank you so much 🙂 I couldn’t figure it out, sometimes you just have to leave it to the pro’s.

    Kind regards,
    Louis

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Hide contact information on post for not logged in users’ is closed to new replies.