Okay
  Public Ticket #3382868
Hide RSVP Button from public
Closed

Comments

  •  1
    Franz started the conversation

    I would like to know how to hide the RSVP Button from people who are not registered to my site – so that only logged in users can see the option to RSVP.

    I already tried:

    .button-class display: none; }

    .logged-in .button-class{ display: block; }

    but it seems that that does not work as it either hides it for everyone regardless if logged in or not or it just shows it to everyone…

    Thank you very much!


    Thank you very much!

  •  877
    Zhivko replied

    Hi,

    No, that won't work.

    Open your theme or child-theme functions.php file and insert following hook:

    /**
     * STEC: Turns off rsvp for not logged in users
     */
    add_action('stec_event_get_front_data', function($data){
        if (false === is_user_logged_in()) {
            $data['rsvp'] = 0;
        }
        return $data;
    });

    Stachethemes Developer

  •  1
    Franz replied

    Awesome, that worked! Thank you very much for your help!