Skip Navigation

[Resolved] Is there a way to "unpublish" posts if the users membership expires?

This support ticket is created 5 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Shane 5 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#1182318

Tell us what you are trying to do? I want users to pay for a membership. If there membership expires, and they haven't renewed, I want their post to no longer be visible. Toolset access does what I need it to do: ONLY users that are members can access pages and create posts. But, If the payment expires, I'll have to manually find the post to unpublish it. Wondering if there's a better way to do this. Let me know if you need additional clarification.

Is there any documentation that you are following? No

Is there a similar example that we can see? No

What is the link to your site? N/A - Site under development.

#1182325

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for contacting our support forum.

Are you using the membership plugin to manage the user memberships? If not, could you let me know how you are managing user memberships.

Please let me know.
Thanks,
Shane

#1182330

Hi Shane. I apologize for not being specific enough. I'm not using a memberships plugin. Is this offered by Toolset?
I've setup a "User Form" so that site visitors can register and be a "subscriber". This is what I'm referring to as member.
What are your recommendations to achieve this?

#1182344

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I would recommend following this documentation for your memberships
https://toolset.com/learn/create-membership-site-wordpress-using-toolset-plugins/

However when it comes to your expired memberships you will need to use the api document here
https://docs.woocommerce.com/document/subscriptions/develop/action-reference/

Particularly the woocommerce_scheduled_subscription_expiration hook.

Unfortunately i'm not familiar with this hook since it was made by woocommerce, however if you are able to get the id of the user whose subscription expires.

Alternatively you will need to have an active listener type code to check to see if the user role changes.

What I can recommend that you do if you need more assistance is to contact a registered contractor to help with the setup of this code for you.
https://toolset.com/contractors/

Thanks,
Shane