Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Limit invitations by user #80
If anyone else is looking to limit invites per user here is how you can add the function.
Boone, Thank you for the tip on invite_anyone_get_invitations_by_inviter_id() it worked well, hopefully I didn't add some extra php in getting the post count below.
I tried to write this code as similar to yours as possible so you might not need to rewrite it all yourself if you decide to implement this. I added an option to the admin section with a checkbox and invite limit amount field. Obviously there is more work for you then just adding the code since language files would all need to be updated too. I was also going to use the code to specify the user level that would be excluded from the limit but for my site this isn't really needed, others might want that option though.
I only had to edit 3 files to get it working slick like. functions.php, admin-panel.php and by-email.php
admin-panel.php - (Added max invites per user to admin panel)
line 166 - (add call settings function to admin section)
line 332 - (add function for setting options checkbox to activate limiting by user and a input field for the amount)
by-email.php (add limit invite count code to front end)
line 520 - (add message of how many more users you are allow to invite. excluding editor and above)
line 1034 - (Add error message if user tries to send more emails than the limit number excludes editors and above)