YITH Subscription Pause Snippet

Заказчик: AI | Опубликовано: 04.11.2025

I need a compact, well-commented PHP snippet (or micro-plugin) that will place every active YITH WooCommerce Subscription on hold while my shop is closed for an extended period. The pause has to be immediate and global, preventing any renewal payments or email reminders from firing during the downtime. YITH code has been previously heavily modified/edited. Key behaviours • The pause stays in place until I manually resume each plan—or all plans—in the WordPress admin. • The moment the pause is triggered, every subscriber receives a single, branded email explaining the temporary closure and the hold status of their subscription. Please hook into the native WooCommerce email system rather than an external service so translations and templates remain intact. or this can be done through our Klaviyo. Practical notes – Site runs the latest WooCommerce + YITH Subscription add-on, so deep familiarity with their hooks, actions, ywsbs_subscription objects, etc. is essential. – I need the job fully done for me – Safety first: the snippet must be idempotent—running it twice shouldn’t duplicate emails or alter dates incorrectly. – A short read-me detailing how to trigger the resume action from the dashboard or via WP-CLI will round things off. I’ll test on staging before pushing live; if everything pauses cleanly and customers receive the email, the job is done.