← All changes
|
admin/modules/template-library/sources/remote.php
+8
-21
3.12.13
→
3.13.4
View file →
| @@ -65,9 +65,9 @@ | ||
| 65 | 65 | */ |
| 66 | 66 | public function import_funnel($args = []) |
| 67 | 67 | { |
| 68 | 68 | $is_pro = apply_filters( 'wpfunnels/is_pro_license_activated', false ); |
| 69 | - $is_store_checkout = isset( $args['is_store_checkout'] ) && $args['is_store_checkout'] === 'true'; | |
| 69 | + $is_store_checkout = isset( $args['is_store_checkout'] ) && filter_var( $args['is_store_checkout'], FILTER_VALIDATE_BOOLEAN ); | |
| 70 | 70 | |
| 71 | 71 | if ( ! $is_pro ) { |
| 72 | 72 | if ( $is_store_checkout ) { |
| 73 | 73 | $sc_count = \WPFunnels\Wpfnl_functions::count_store_checkout_funnels(); |
| @@ -97,28 +97,15 @@ | ||
| 97 | 97 | update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'store_checkout' ); |
| 98 | 98 | $funnel->update_meta( $funnel_id, '_is_store_checkout', 'yes' ); |
| 99 | 99 | } else { |
| 100 | 100 | if( $funnel_id ){ |
| 101 | - | |
| 102 | - if( isset( $general_settings['funnel_type'] ) ){ | |
| 103 | - if( 'woocommerce' == $general_settings['funnel_type'] ){ | |
| 104 | - $general_settings['funnel_type'] = 'sales'; | |
| 105 | - update_option( '_wpfunnels_general_settings', $general_settings ); | |
| 106 | - } | |
| 107 | - if( 'sales' == $general_settings['funnel_type'] ){ | |
| 108 | - // Check if LMS add-on is active AND at least one LMS plugin (LearnDash or CreatorLMS) is active | |
| 109 | - if( Wpfnl_functions::is_lms_addon_active() && Wpfnl_functions::is_any_lms_plugin_active() && isset($args['type']) && 'lms' === $args['type'] ){ | |
| 110 | - update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lms' ); | |
| 111 | - } elseif( Wpfnl_functions::is_wc_active() && isset($args['type']) && 'wc' === $args['type'] ){ | |
| 112 | - update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'wc' ); | |
| 113 | - } elseif( isset($args['type']) && 'lead' === $args['type'] ){ | |
| 114 | - update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lead' ); | |
| 115 | - } | |
| 116 | - }else{ | |
| 117 | - if( isset($args['type']) && 'lead' === $args['type'] ){ | |
| 118 | - update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lead' ); | |
| 119 | - } | |
| 120 | - } | |
| 101 | + // Check if LMS add-on is active AND at least one LMS plugin (LearnDash or CreatorLMS) is active | |
| 102 | + if( Wpfnl_functions::is_lms_addon_active() && Wpfnl_functions::is_any_lms_plugin_active() && isset($args['type']) && 'lms' === $args['type'] ){ | |
| 103 | + update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lms' ); | |
| 104 | + } elseif( Wpfnl_functions::is_wc_active() && isset($args['type']) && 'wc' === $args['type'] ){ | |
| 105 | + update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'wc' ); | |
| 106 | + } elseif( isset($args['type']) && 'lead' === $args['type'] ){ | |
| 107 | + update_post_meta( $funnel_id, '_wpfnl_funnel_type', 'lead' ); | |
| 121 | 108 | } |
| 122 | 109 | } |
| 123 | 110 | } |
| 124 | 111 | |