Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!function_exists('wcfm_delete_post_meta)) {
- function wcfm_delete_post_meta($post_id, $key) {
- if ( defined( 'ICL_SITEPRESS_VERSION' ) && ! ICL_PLUGIN_INACTIVE && class_exists( 'SitePress' ) ) {
- global $sitepress;
- $current_language = $sitepress->get_current_language();
- delete_post_meta( $post_id, $key . '_' . $current_language);
- } else {
- delete_post_meta( $post_id, $key );
- }
- }
- }
- add_action( 'wcfm_memberships_manage_from_process', function($new_membership_id) {
- if(wcfm_get_post_meta($new_membership_id, 'subscription_welcome_email_subject', true)) {
- wcfm_delete_post_meta($new_membership_id, 'subscription_welcome_email_subject');
- }
- if(wcfm_get_post_meta($new_membership_id, 'subscription_welcome_email_content', true)) {
- wcfm_delete_post_meta($new_membership_id, 'subscription_welcome_email_content');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement