WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Limit the amount of times a particular user can reserve events (3 posts)

  1. eqhes
    Member
    Posted 1 year ago #

    Hi,

    I'm using:
    - WordPress 3.5
    - Events Manager 5.3.3

    Say that we have got 15 active events and we want that each user could reserve only a limited number of events (5, for example). Is this possible?

    Thank you in advance.
    Regards,
    --
    David

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

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    possible if using registered users, i can't find the snippet I've seen that does this (there was one lying around here somewhere), but generally speaking you can hook into

    em_booking_is_open

    and then return false using something along the linse of

    if( is_user_logged_in() ){
    $EM_Person = new EM_Person(get_current_user_id());
    if( count($EM_Person->get_bookings()->bookings) > 5 ){
      return false;
    }}

    warning: wrote this ad hoc, not tested at all but roughly correct :)

  3. eqhes
    Member
    Posted 1 year ago #

    I was thinking on registered users. The code seems pretty simple but I can't test it right now. I'm sure this will work with little customizations so I set this topic as resolved. Thank you again! ;)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic