8889841cwp-content/plugins/yith-woocommerce-compare/plugin-fw/includes/class-yith-bh-onboarding.php000064400000006015150513760670034121 0ustar00home/clixcotz/lions.clix.co.tzregister_styles_and_scripts(); } if ( isset( $options['enqueue_script'] ) ) { foreach ( $options['enqueue_script'] as $handle ) { wp_enqueue_script( $handle ); } } if ( isset( $options['enqueue_style'] ) ) { foreach ( $options['enqueue_style'] as $handle ) { wp_enqueue_style( $handle ); } } wp_enqueue_script( 'yith-bh-onboarding' ); wp_enqueue_style( 'yith-bh-onboarding' ); include YIT_CORE_PLUGIN_TEMPLATE_PATH . '/bh-onboarding/onboarding-tabs.php'; } /** * Save options * * @return void */ public function save_options() { check_ajax_referer( 'yith-bh-onboarding-save-options' ); if ( ! isset( $_REQUEST['yith-plugin'], $_REQUEST['tab'] ) ) { wp_send_json_error( __( 'It is not possible save the options', 'yith-plugin-fw' ) ); } $slug = sanitize_text_field( wp_unslash( $_REQUEST['yith-plugin'] ) ); $posted = $_REQUEST; // the options are filtered by each plugin. $options = apply_filters( 'yith_bh_onboarding_' . $slug, array() ); $tab = $posted['tab']; if ( apply_filters( 'yith_bh_onboarding_save_options_' . $slug, isset( $options['tabs'][ $tab ]['options'] ), $posted ) ) { foreach ( $options['tabs'][ $tab ]['options'] as $single_option ) { if ( isset( $posted[ $single_option['id'] ] ) ) { $value = $posted[ $single_option['id'] ] ?? false; $value = YIT_Plugin_Panel_WooCommerce::sanitize_option( $value, $single_option, $value ); $value = apply_filters( 'yith_bh_onboarding_save_option_value', $value, $single_option, $slug ); update_option( $single_option['id'], $value ); } } } wp_send_json_success(); } } } YITH_BH_Onboarding::get_instance();