In this tutorial, we will show you how to restrict events by donation form in the GiveWP plugin. For example, you may want to hold a dinner to thank donors for your education cause in a poor country, or even an online event exclusively for your startup project donors.
For this, you will need to use an event plugin such as The Events Calendar, for example. With this plugin, you will create the event you want to celebrate.
Next, you will need the WordPress Conditional Post Restrictions plugin. This WordPress plugin allows you to apply conditional restrictions to any post, page, or other custom post types generated by plugins like The Events Calendar.
A great thing is that you can use parameters from other plugins to create conditional restrictions for your events. For example, in this case, we will use a specific donation form as the parameter we will apply to the restriction of our events.
Just follow these simple steps (assuming you have installed an event plugin and created the event you need to edit):
1- Install the ‘WordPress Conditional Post Restrictions’ plugin
You can download the plugin here:
Download WordPress Conditional Post Restrictions Plugin - or - Read more
Once installed and activated, you can proceed to apply restrictions to your events for users who donate to a specific cause on your GiveWP donation platform.
2- How to restrict an event by donation form
To restrict an event to donors to a specific cause in your GiveWP platform, you need to apply the changes in the edit event form.
In this case, we are using The Events Calendar plugin, so we need to:
- Go to Events
- Open an event you want to restrict.
- Scroll down to the Restriction rules section.
Once there, you need to select the following values to restrict this event to users who donate to a specific form:
- Enable content restrictions: Yes
- What happens when the conditions are met: Allow access. This means only users who meet the condition we’ll set up will have access to this event.
- Condition 1: User has donated for form = Donation Form. You need to select the donation form to which you want to restrict this event. In this case, we’ve selected the example donation form that comes with GiveWP.
- Update the event to apply the changes.
3- How to restrict an entire event category for users who donate to a specific cause
If you do not want to edit the events individually, you can easily create an event category and then apply the same restriction to that entire category.
Once you have created an event category that you want to edit, you need to open that category to edit it individually.
- Go to Events > Categories.
- Open the category you want to edit.
Once opened, you need to apply the following values to restrict this event category by donation form.
- Enable the conditional restrictions: Yes
- Apply restrictions to: Category and posts
- What happens when the conditions are met: Allow access. This means only users who meet the condition we’ll set up will have access to the events in within this category.
- Condition 1: User has donated for form = Donation Form. You need to select the donation form to which you want to restrict this event. In this case, we’ve selected the example donation form that comes with GiveWP.
4- What happens when users try to access an event that is not available to them?
If users have donated to a cause different from the one we’ve selected here, and try to access an event that is not available for them, you have several options to decide what happens in that case. You can do it in the global settings of WordPress Conditional Post Restrictions.
To configure the global setting of WordPress Conditional Post Restrictions, go to Settings > Post Restrictions in wp-admin. Once there, you have these options:
- You’ll see a list of user roles for which the conditions won’t be applied. By default, we will not apply restrictions for administrators, editors, and any user with the capability edit_others_posts.
- You can select what happens when the post is restricted and what happens when a category is restricted.
- Once you select what happens when users try to access an event that is not available for them, save changes.
That’s really simple!
This is a new big step in your GiveWP donations platform. You have endless possibilities to configure your events, posts, pages, and any other post type using the WordPress Conditional Post Restriction plugin.
You can offer events and any other type of content as rewards for donations. This way, users will be encouraged to donate, and you won’t have to spend lots of time programming these conditional restrictions. Just some clicks, and done!
You can download the plugin here:
Download WordPress Conditional Post Restrictions Plugin - or - Read more