Advertisement
palsushobhan

Disallow membership plan specific welcome emails

Oct 31st, 2024
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.92 KB | None | 0 0
  1. if(!function_exists('wcfm_delete_post_meta)) {
  2.    function wcfm_delete_post_meta($post_id, $key) {
  3.        if ( defined( 'ICL_SITEPRESS_VERSION' ) && ! ICL_PLUGIN_INACTIVE && class_exists( 'SitePress' ) ) {
  4.            global $sitepress;
  5.            $current_language = $sitepress->get_current_language();
  6.            delete_post_meta( $post_id, $key . '_' . $current_language);
  7.        } else {
  8.            delete_post_meta( $post_id, $key );
  9.        }
  10.    }
  11. }
  12. add_action( 'wcfm_memberships_manage_from_process', function($new_membership_id) {
  13.    if(wcfm_get_post_meta($new_membership_id, 'subscription_welcome_email_subject', true)) {
  14.        wcfm_delete_post_meta($new_membership_id, 'subscription_welcome_email_subject');
  15.    }
  16.    if(wcfm_get_post_meta($new_membership_id, 'subscription_welcome_email_content', true)) {
  17.        wcfm_delete_post_meta($new_membership_id, 'subscription_welcome_email_content');
  18.    }
  19. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement