I have some tasks I will like to resolve here… I will appreciate some patience and honest guidance. Thank you everyone.
I’m setting up a book database that will display google adsense ads. I want to be able to remove ads for people who support the site on patreon. I have WP Bakery, so I can disable certain elements based on role. I also have Userpro, which has the ability to allow users to submit inputs for custom fields (in this case the email they use for patreon).
Breaking it down:
I need to prevent the same custom field input (patreon email) being used twice
I need to check the custom field input (patreon email) against the retrieved email from patreon patreon
I need to see if the current pledge is active
I need to see if the current pledge is above $2.99
If the current pledge is active AND above $2.99 AND the custom field input matched that retrieved from patreon then I need a specific role (customer) assigned to the user
If the current pledge is inactive OR below $3.00 OR the custom field input does not match that retrieved from patreon then I need the role removed and returned to the default (subscriber)
For PW already checks the email, and uses it to create a WP account for the user if the user is not logged into WP already (to an existing account) and the email is verified.
If the user is already logged into WP and comes with a valid Patreon account, then PW links that Patreon account to that user’s WP account.
Active pledge can be acquired via Patreon_Wordpress::getUserPatronage(); for the current user.
You can check the state of a user, and if the user is logged into WP, logged into Patreon and have an active pledge amount over 2.99 ( Patreon_Wordpress::getUserPatronage() >= 3), then you can just change the user role to customer role which you seem to be using on your site. If not, reverting it back to subscriber.
So, what Patreon Wordpress does is it hides posts or sections of posts, but it doesn’t actually change the role. Which is why I need a custom role changer linked to patreon.
What I want done is to have a custom field where the wordpress user manual enters their patreon email (this is not the standard email field, this is a custom field). If the email provided matches the email of an active patreon donor with an active pledge of $3.00 or more per month then it changes the user’s role on wordpress (from subscriber to customer). I also need to prevent two different users from having the same patreon email field. Finally, if the email is changed, if the donation lapses, or if the donation amount goes below $3.00, I need it so that the role is changed back to (from customer to subscriber)
Breaking it down:
I need to prevent the same custom field input (patreon email) being used twice
I need to check the custom field input (patreon email) against the retrieved email from patreon patreon
I need to see if the current pledge is active
I need to see if the current pledge is above $2.99
If the current pledge is active AND above $2.99 AND the custom field input matched that retrieved from patreon then I need a specific role (customer) assigned to the user
If the current pledge is inactive OR below $3.00 OR the custom field input does not match that retrieved from patreon then I need the role removed and returned to the default (subscriber)
[quote=“Newbie, post:6, topic:1416, full:true”]What I want done is to have a custom field where the wordpress user manual enters their patreon email (this is not the standard email field, this is a custom field)
[/quote]
That’s where you enter custom code territory. If you have a custom field, you would need to handle that field’s input somehow. Ready made plugins would not be able to directly handle a custom field. You could do something with ACF if you are using ACF, but in any case that would also require some code logic to be put in.