Support

Home Forums Event Espresso Premium Members only plug-in- regarding ee4-wp-user-integ

Members only plug-in- regarding ee4-wp-user-integ

Posted: October 24, 2016 at 5:23 am


Omar Paloma

October 24, 2016 at 5:23 am

Hey Tony, Did you have a chance to look at PM Pro? (https://eventespresso.com/topic/ee4-wp-user-integration-member-only-tickets/
https://eventespresso.com/topic/creating-member-discounts/
https://eventespresso.com/topic/automatic-pricing-discounts-for-members-vs-subscribers-for-logged-in-users/)

Last year I used the WP capability list_roles with a hidden PM Pro leve. I also hid the admin section from users with Adminimize. I used the plug in “Members” by Jason Tadlock to assign capabilities to this hidden role.

This was complex and confusing for me and for my customers. I was thinking, if I understand correctly, for a user to see the EE4 menus they would need to have the follow capabilities:

ee_read_ee
ee_read_events

Imagine this scenario:

In PMPro, I create user roles


'bronze', 'silver' and 'gold' 

with the Members plug-in in WP:Users:Roles I assign them a random Event Espresso ‘Read’ capability such as

'ee_read_venue'

but I DON’T assign the following capability to ‘bronze, silver’ gold’

'ee_read_ee, ee_read_events'

I know that multiple roles could have the same capability. In the ticket section of EE4 I would create a members ticket and enter

ee_read_venue

in the ticket capability requirement box.

Would this allow ‘bronze/silver/gold’ members to see the members only ticket?

Would I be safe believing that ‘bronze/silver/gold’ not have ‘practical access’ to

ee_read_venue

because they don’t have access to the EE menus?

The members plug-in has the ability to make ‘custom’ capabilities. Would it be better to create a null custom capability and assign that capability to ‘bronze/silver/gold’

Is there an easier way to do this?


Tony

  • Support Staff

October 25, 2016 at 5:07 am

Hi there,

Hey Tony, Did you have a chance to look at PM Pro?

I never received a copy of the add-on, so I’ve not investigated this any further.

Would I be safe believing that ‘bronze/silver/gold’ not have ‘practical access’ to
ee_read_venue
because they don’t have access to the EE menus?

They would need to navigate directly to a venue, but even then could not edit the venue without the edit cap, so yes.

The members plug-in has the ability to make ‘custom’ capabilities. Would it be better to create a null custom capability and assign that capability to ‘bronze/silver/gold’

I’m not sure I follow what your doing, why are you using a default EE cap to compare tickets?

The idea of the ticket capability check is you can use ANY cap you prefer, it doesn’t matter what it is as long as the user account that you want to view the ticket has that cap. That can be done directly within the account by adding the capability to that account, or by assigning the cap to the role (A role is just a collcation of capabilities) that is assigned to the users account.

When you include membership type plugins you generally want to only allow users that have a membership to view the tickets (but not always) so you want to check a capability assigned to the membership level.

The last time I looked into PMP it seemed to manage ‘memberships’ etc completely separate from the users role, which mean that there were no specific capabilities assigned to the user that would indicate the role was ‘active’, however there was an add-on available to do this:

https://eventespresso.com/topic/hook-or-filter-to-display-available-tickets-for-membership-status/

However note, I have not used the add-on so don’t know how it works. I found it last time whilst investigating another question (the one linked above) and it seemed to suit the needs of that user.


Omar Paloma

October 28, 2016 at 9:23 am

Thanks for your reply. I can send you a copy of the PMPro Plug-in. Please let me know how to do this.

PMpro is an excellent plug-in with many add-ons, including and User role addon. Unfortunately, I know enough coding to be dangerous and not necessarily useful so I haven’t investigated all the nuances of this addon.

To answer your question,

“…why are you using a default EE cap to compare tickets?”

I’m not. I am using the EE caps to distinguish the PMpro members who can purchase members only tickets.

In my set-up, I have users who are members and users who just subscribers. To give all user with ‘read’ CAPS the right to purchase members tickets would mean users with or without membership. Because I am not an expert (or even a knowledgeable pro), I didn’t want to risk using the built-in WP caps when it appeared that the ee4 caps were a safer ‘protected’ alternative; meaning I felt that if I assigned the users ee4 Caps as above, the user assigned those CAPs wouldn’t be able to do any harm.

You mentioned,

“The idea of the ticket capability check is you can use ANY cap you prefer, it doesn’t matter what it is as long as the user account that you want to view the ticket has that cap. That can be done directly within the account by adding the capability to that account,..”

I don’t understand. Can you explain?


Josh

  • Support Staff

October 28, 2016 at 10:59 am

Hi Omar,

That’s a mistaken assumption that it’d be safer to use the caps added by EE. The caps added by EE are for a completely different purpose: They’re for allowing non-admins access to EE admin features. They’re not intended to be used for allowing members to access specific member only tickets.

The prerequiste to making any membership level plugin work with Event Espresso 4’s WP user integration is that membership level plugin needs to use custom capabilities when it sets up its user roles. Those are the capabilities you use in the Ticket Capability requirement field in EE ticket editor.


Omar Paloma

October 30, 2016 at 5:36 pm

Thanks Josh. That clarifies things. I will use custom caps.To be clear the safety is in having a better understanding the ee4 caps vs not fully understanding the built in WP caps.

I still would like to understand this:

Tony mentioned,

The idea of the ticket capability check is you can use ANY cap you prefer, it doesn’t matter what it is as long as the user account that you want to view the ticket has that cap. That can be done directly within the account by adding the capability to that account,..


Omar Paloma

October 31, 2016 at 12:56 am

Also, would you like me to send you a copy of PMPRO?


Tony

  • Support Staff

October 31, 2016 at 6:59 pm

I still would like to understand this:
Tony mentioned,
The idea of the ticket capability check is you can use ANY cap you prefer, it doesn’t matter what it is as long as the user account that you want to view the ticket has that cap. That can be done directly within the account by adding the capability to that account,..

What would you like to know?

You set the ticket capability check on the ticket to match a capability you have assigned to the user, if they have the capability they will view the ticket, if they do not then they will not view the ticket.

Also, would you like me to send you a copy of PMPRO?

I can download the latest version of Paid Memberships Pro from here:

https://wordpress.org/plugins/paid-memberships-pro/

However I don’t have access to any of the add-ons.

As far as I can tell Paid Memberships Pro does not add/remove capabilities to/from a user/role if the purchase a membership or their membership expires, the add-on I linked to in this thread:

https://eventespresso.com/topic/hook-or-filter-to-display-available-tickets-for-membership-status/

appears to add that functionality to PMP.

So lets say your subscriber purchases a ‘bronze’ membership that you have created, you need some kind of capability assigned to the account that EE can use to check if they have access to the ticket, lets say in this case you use ‘bronze_cap’ (which would be set in the ticket capability in the editor).

Paid Memberships Pro needs to be able to assign that capability to the user when they purchase the membership (so they now have access to the ticket) and remove that capability if the membership expires (so they no longer have access to tickets with that cap).

So, does PMP allow for that functionality?


Omar Paloma

November 1, 2016 at 4:01 pm

I used this last year without difficulty, though I confess that I never checked to see if the CAP was removed on the expiration of the membership. I will do that this year. I believe my question has been answered. I just wanted to be sure that I was using this feature properly and safely. With the change that Josh suggested (which was how I did it last year) I believe I am. So you may, if you wish, mark this ‘resolved’. Thanks so much 🙂


Tony

  • Support Staff

November 1, 2016 at 4:17 pm

You’re most welcome 🙂

The support post ‘Members only plug-in- regarding ee4-wp-user-integ’ 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.

Event Espresso