Posted: July 25, 2017 at 3:12 am
|
Hi, Is there a way to enable the Restrict content pro Metabox on the eventpages or is there another way to easily restrict custom user roles to view an event? Thanks in advance! |
|
And now with working Img! Thanks! |
Hi there, You can add some code to your site to use Restrict Content pro with Event Espresso events: https://gist.github.com/joshfeck/60fdc20490effadf80cd45ca0b841253 You can add the above to a functions plugin or into your WordPress theme’s functions.php file. |
|
|
Hi, Thanks for the reply! I’ve added the code to the top of the functions file but the metabox doesn’t show? Is there something els I need to do to make it work? Thanks! |
May I ask which functions file? Was it within a plugin or within a theme folder? If a plugin is the plugin activated? |
|
|
Hi, I’ve added it to the Child theme’s Functions file. Thanks! |
Can you try adding it to a custom functions plugin, Josh provided a link to a tutorial on creating one above. |
|
Oh hey sorry! The code I gave you was for the Restrict Content (not Pro) plugin. Here’s a different gist that’s for Restrict Content Pro: https://gist.github.com/joshfeck/12610ce3e55737f05b4afd6e037a0140 It’d be best to test this code thoroughly with your specific set up. The code has been tested but only to see if it would restrict content from non-members. |
|
|
Hi, Thanks Josh & Tony for both your answers! The code Josh linked did the trick. I’ll do some more testing to see if it actually works. One more question. Is there also a way to restrict a ticket to a user role? Thanks a lot! |
The WP User Integration add-on has a feature that allows you to set a capability on a ticket. For example if user role x has capability y, and you set ticket z‘s capability requirement to require capability y, then user x can get that ticket. Users accounts without capability y (and anyone not logged into the site) cannot get ticket z. |
|
|
Hi, Right! Totally missed that feature! Thanks for the support! Kind regards! |
The support post ‘Restrict content pro – Restrict content metabox’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.