WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Hook into regiatrstion? (5 posts)

  1. gabbsmo
    Member
    Posted 1 year ago #

    I'm evaluating different soultions for event registrstion. One of the requirements is that only users with a certain amounts points should be able to attend a event. I'm intending to store this points field in the database and read it when a user attempt to register for a event.

    Is there a hook in EM that allows this?

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    there's quite a few hooks in EM, so there's various places you could do this.

    I guess the best one would be

    return apply_filters('em_bookings_is_open', $return, $this);

    in classes/em-bookings.php which you can set $return to true/false depending if you want bookings to be available or not.

  3. gabbsmo
    Member
    Posted 1 year ago #

    There is no documentation for the available hooks in EM?

  4. gabbsmo
    Member
    Posted 1 year ago #

    Would somethings like this in functions.php disable the sign up form for non eligible users?

    add_filter('em_bookings_is_open', has_points, 10, 0);

    function has_points() {
    if($points > 0)
    return true;
    else
    return false;
    }

    Does em_bookings_is_open just control the form or the registration process itself. Even if I set it to false, would a clever person still be able to sign up through a HTTP request?

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    not at the moment. hoping to add more docs and codex soon

    this filter should work and it wouldn't be possible to circumvent it as this check should be done server-side before actually adding the booking

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic