Okay
  Public Ticket #1874936
Submit an event front-end
Closed

Comments

  • virginiarae78 started the conversation

    Hi There,

    I'm confused why there is the option to submit events to the user level from the individual calendars (Who can add events from the front-end) if the "show submit event form" in general settings shows the submit an event form to all logged in users once selected?

    I would like to be able to hide the form entirely for specific users. Is this not possible? And if not, this should be made more clear. 

    Virginia

  •  877
    Zhivko replied

    Hi,

    In your theme functions.php file add following action:

    add_action('wp_head', function() {
        
       
        $allowed_users_id = array(
            // Allowed users by id
            1,2,3,4,5,6
        );
        
        $userid = get_current_user_id();
        
        if (!in_array($userid, $allowed_users_id)) {
            ?>
            <style>
                .stec-event-create-form {
                    display: none !important;
                }
            </style>
            <?php
        }
    });

    Replace 

    1,2,3,4,5,6

    with users id which are allowed to submit events.


    Stachethemes Developer