← All changes
|
admin/modules/createFunnel/class-wpfnl-create-funnel.php
+10
-28
3.12.4
→
3.13.3
View file →
| @@ -54,36 +54,18 @@ | ||
| 54 | 54 | if ($is_store_checkout) { |
| 55 | 55 | update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'store_checkout' ); |
| 56 | 56 | $funnel_type = 'store_checkout'; |
| 57 | 57 | } else { |
| 58 | - $general_settings = get_option( '_wpfunnels_general_settings' ); | |
| 59 | - if( isset($general_settings['funnel_type']) ){ | |
| 60 | - if( 'woocommerce' == $general_settings['funnel_type'] ){ | |
| 61 | - $general_settings['funnel_type'] = 'sales'; | |
| 62 | - update_option( '_wpfunnels_general_settings', $general_settings ); | |
| 63 | - | |
| 64 | - } | |
| 65 | - | |
| 66 | - if( 'sales' == $general_settings['funnel_type'] ){ | |
| 67 | - // Check if LMS add-on is active AND at least one LMS plugin (LearnDash or CreatorLMS) is active | |
| 68 | - if( Wpfnl_functions::is_lms_addon_active() && Wpfnl_functions::is_any_lms_plugin_active() && isset($payload['type']) && 'lms' === $payload['type'] ){ | |
| 69 | - update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lms' ); | |
| 70 | - $funnel_type = 'lms'; | |
| 71 | - }elseif( Wpfnl_functions::is_wc_active() && isset($payload['type']) && 'wc' === $payload['type'] ){ | |
| 72 | - update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'wc' ); | |
| 73 | - $funnel_type = 'wc'; | |
| 74 | - }elseif( isset($payload['type']) && 'lead' === $payload['type'] ){ | |
| 75 | - update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lead' ); | |
| 76 | - $funnel_type = 'lead'; | |
| 77 | - } | |
| 78 | - | |
| 79 | - }else{ | |
| 80 | - | |
| 81 | - if( isset($payload['type']) && 'lead' === $payload['type'] ){ | |
| 82 | - update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lead' ); | |
| 83 | - $funnel_type = 'lead'; | |
| 84 | - } | |
| 85 | - } | |
| 58 | + // Check if LMS add-on is active AND at least one LMS plugin (LearnDash or CreatorLMS) is active | |
| 59 | + if( Wpfnl_functions::is_lms_addon_active() && Wpfnl_functions::is_any_lms_plugin_active() && isset($payload['type']) && 'lms' === $payload['type'] ){ | |
| 60 | + update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lms' ); | |
| 61 | + $funnel_type = 'lms'; | |
| 62 | + }elseif( Wpfnl_functions::is_wc_active() && isset($payload['type']) && 'wc' === $payload['type'] ){ | |
| 63 | + update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'wc' ); | |
| 64 | + $funnel_type = 'wc'; | |
| 65 | + }elseif( isset($payload['type']) && 'lead' === $payload['type'] ){ | |
| 66 | + update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lead' ); | |
| 67 | + $funnel_type = 'lead'; | |
| 86 | 68 | } |
| 87 | 69 | } |
| 88 | 70 | } |
| 89 | 71 | |