Settings', ); return array_merge( $mylinks, $links ); } /** * Add new settings for cart abandonment settings. * * @since 1.1.5 */ public function wcf_initialize_settings() { // Start: Settings for cart abandonment. add_settings_section( WCF_CA_GENERAL_SETTINGS_SECTION, /* translators: %1$s: html start, %2$s: html end*/ sprintf( __( '%1$sCart Abandonment Settings%2$s', 'woo-cart-abandonment-recovery' ), '', '' ), array( $this, 'wcf_cart_abandonment_options_callback' ), WCF_CA_PAGE_NAME ); add_settings_field( 'wcf_ca_status', __( 'Enable Tracking', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_status_callback' ), WCF_CA_PAGE_NAME, WCF_CA_GENERAL_SETTINGS_SECTION, array( __( 'Start capturing abandoned carts.

Note: Cart will be considered abandoned if order is not completed in cart abandoned cut-off time.', 'woo-cart-abandonment-recovery' ) ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_status' ); add_settings_field( 'wcf_ca_cron_run_time', __( 'Cart abandoned cut-off time', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_cron_run_time_callback' ), WCF_CA_PAGE_NAME, WCF_CA_GENERAL_SETTINGS_SECTION, array( __( 'Minutes.

Note: Consider cart abandoned after above entered minutes of item being added to cart and order not placed.', 'woo-cart-abandonment-recovery' ) ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_cron_run_time' ); add_settings_field( 'wcf_ca_ignore_users', __( 'Disable Tracking For', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_ignore_users_callback' ), WCF_CA_PAGE_NAME, WCF_CA_GENERAL_SETTINGS_SECTION, array( '
Note:' . __( ' It will ignore selected users from abandonment process when they logged in, and hence they can not receive mail for cart abandoned by themselves.', 'woo-cart-abandonment-recovery' ) . '' ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_ignore_users' ); add_settings_field( 'wcf_ca_excludes_orders', __( 'Exclude email sending For', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_exclude_orders_callback' ), WCF_CA_PAGE_NAME, WCF_CA_GENERAL_SETTINGS_SECTION, array( '
Note:' . __( ' It will not send future recovery emails to selected order status and will mark as recovered.', 'woo-cart-abandonment-recovery' ) . '' ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_excludes_orders' ); add_settings_field( 'wcar_email_admin_on_recovery', __( 'Notify recovery to admin', 'woo-cart-abandonment-recovery' ), array( $this, 'wcar_email_admin_on_recovery' ), WCF_CA_PAGE_NAME, WCF_CA_GENERAL_SETTINGS_SECTION, array( __( 'This option will send an email to admin on new order recovery.', 'woo-cart-abandonment-recovery' ) ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcar_email_admin_on_recovery' ); add_settings_field( 'wcf_ca_global_param', __( 'UTM parameters', 'woo-cart-abandonment-recovery' ), array( $this, 'wcar_add_param_to_recovery_url' ), WCF_CA_PAGE_NAME, WCF_CA_GENERAL_SETTINGS_SECTION, array( '
' . __( 'The UTM parameters will be appended to the checkout page links which is available in the recovery emails.', 'woo-cart-abandonment-recovery' ) . '' ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_global_param' ); // End: General Settings for cart abandonment. // Start: Delete coupons settings for cart abandonment. add_settings_section( WCF_CA_COUPONS_SETTINGS_SECTION, /* translators: %1$s: html start, %2$s: html end*/ sprintf( __( '%1$sCoupons Settings%2$s', 'woo-cart-abandonment-recovery' ), '', '' ), array( $this, 'wcf_cart_abandonment_options_callback' ), WCF_CA_PAGE_NAME ); add_settings_field( 'wcf_ca_auto_delete_coupons', __( 'Delete Coupons Automatically', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_auto_delete_coupons_callback' ), WCF_CA_PAGE_NAME, WCF_CA_COUPONS_SETTINGS_SECTION, array( __( 'Delete coupons automatically on weekly basis.

Note: This option will set a weekly cron to delete all expired and used coupons automatically in the background.

', 'woo-cart-abandonment-recovery' ) ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_auto_delete_coupons' ); add_settings_field( 'wcf_ca_delete_coupons', __( 'Delete Coupons Manually', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_delete_coupons_callback' ), WCF_CA_PAGE_NAME, WCF_CA_COUPONS_SETTINGS_SECTION, array( '
' . __( '
Note: This will delete all expired and used coupons that were created by Woo Cart Abandonment Recovery.

', 'woo-cart-abandonment-recovery' ) ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_delete_coupons' ); // End: Delete coupons settings for cart abandonment. // Start: Settings for email templates. add_settings_section( WCF_CA_EMAIL_SETTINGS_SECTION, /* translators: %1$s: html start, %2$s: html end*/ sprintf( __( '%1$sEmail Settings%2$s', 'woo-cart-abandonment-recovery' ), '', '' ), array( $this, 'wcf_cart_abandonment_options_callback' ), WCF_CA_PAGE_NAME ); add_settings_field( 'wcf_ca_from_name', __( '"From" Name', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_from_name_callback' ), WCF_CA_PAGE_NAME, WCF_CA_EMAIL_SETTINGS_SECTION, array( __( 'Name will appear in email sent.', 'woo-cart-abandonment-recovery' ) ) ); add_settings_field( 'wcf_ca_from_email', __( '"From" Address', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_from_email_callback' ), WCF_CA_PAGE_NAME, WCF_CA_EMAIL_SETTINGS_SECTION, array( __( 'Email which send from.', 'woo-cart-abandonment-recovery' ) ) ); add_settings_field( 'wcf_ca_reply_email', __( '"Reply To" Address', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_reply_email_callback' ), WCF_CA_PAGE_NAME, WCF_CA_EMAIL_SETTINGS_SECTION, array( __( 'When a user clicks reply, which email address should that reply be sent to?', 'woo-cart-abandonment-recovery' ) ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_from_name' ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_from_email', array( $this, 'wcf_ca_from_email_validation' ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_reply_email', array( $this, 'wcf_ca_reply_email_validation' ) ); // End: Settings for email templates. // Start: Settings for recovery report email templates. add_settings_section( WCF_CA_RECOVERY_EMAIL_SETTINGS_SECTION, /* translators: %1$s: html start, %2$s: html end*/ sprintf( __( '%1$sRecovery Report Emails%2$s', 'woo-cart-abandonment-recovery' ), '', '' ), array( $this, 'wcf_cart_abandonment_options_callback' ), WCF_CA_PAGE_NAME ); add_settings_field( 'wcf_ca_send_recovery_report_emails_to_admin', __( 'Send recovery report emails', 'woo-cart-abandonment-recovery' ), array( $this, 'send_recovery_report_emails_to_admin' ), WCF_CA_PAGE_NAME, WCF_CA_RECOVERY_EMAIL_SETTINGS_SECTION, array( __( 'Enable sending recovery report emails.', 'woo-cart-abandonment-recovery' ) ) ); add_settings_field( 'wcf_ca_admin_email', __( 'Email address', 'woo-cart-abandonment-recovery' ), array( $this, 'admin_email_callback' ), WCF_CA_PAGE_NAME, WCF_CA_RECOVERY_EMAIL_SETTINGS_SECTION, array( '
' . __( 'Email address to send recovery report emails. For multiple emails, add each email address per line.', 'woo-cart-abandonment-recovery' ) . '' ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_send_recovery_report_emails_to_admin' ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_admin_email', array( $this, 'wcf_ca_report_emails_validation' ) ); // End: Settings for recovery report email templates. // Start: Settings for coupon code. add_settings_field( 'wcf_ca_zapier_tracking_status', __( 'Enable Webhook', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_zapier_tracking_status_callback' ), WCF_CA_PAGE_NAME, WCF_CA_ZAPIER_SETTINGS_SECTION, array( __( 'Allows you to trigger webhook automatically upon cart abandonment and recovery.', 'woo-cart-abandonment-recovery' ) ) ); add_settings_field( 'wcf_ca_zapier_cart_abandoned_webhook', __( 'Webhook URL', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_zapier_cart_abandoned_webhook_callback' ), WCF_CA_PAGE_NAME, WCF_CA_ZAPIER_SETTINGS_SECTION, array( '', 'woo-cart-abandonment-recovery' ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_zapier_tracking_status' ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_zapier_cart_abandoned_webhook' ); add_settings_section( WCF_CA_ZAPIER_SETTINGS_SECTION, /* translators: %1$s: html start, %2$s: html end*/ sprintf( __( '%1$sCoupon Code Settings%2$s', 'woo-cart-abandonment-recovery' ), '', '' ), array( $this, 'wcf_cart_abandonment_options_callback' ), WCF_CA_PAGE_NAME ); add_settings_field( 'wcf_ca_coupon_code_status', __( 'Create Coupon Code', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_coupon_code_status_callback' ), WCF_CA_PAGE_NAME, WCF_CA_ZAPIER_SETTINGS_SECTION, array( __( 'Auto-create the special coupon for the abandoned cart to send over the emails.', 'woo-cart-abandonment-recovery' ) ) ); add_settings_field( 'wcf_ca_discount_type', __( 'Discount Type', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_discount_type_callback' ), WCF_CA_PAGE_NAME, WCF_CA_ZAPIER_SETTINGS_SECTION, array( '', 'woo-cart-abandonment-recovery' ) ); add_settings_field( 'wcf_ca_coupon_amount', __( 'Coupon Amount', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_coupon_amount_callback' ), WCF_CA_PAGE_NAME, WCF_CA_ZAPIER_SETTINGS_SECTION, array( '', 'woo-cart-abandonment-recovery' ) ); add_settings_field( 'wcf_ca_coupon_expiry', __( 'Coupon Expires After', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_coupon_expiry_callback' ), WCF_CA_PAGE_NAME, WCF_CA_ZAPIER_SETTINGS_SECTION, array( __( '

Note: . Enter zero (0) to restrict coupon from expiring.', 'woo-cart-abandonment-recovery' ) ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_coupon_expiry' ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_coupon_expiry_unit' ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_coupon_code_status' ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_discount_type' ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_coupon_amount', array( $this, 'wcf_ca_coupon_amount_validation' ) ); // End: Settings for coupon code. // Start: Settings for Zapier. add_settings_section( WCF_CA_ZAPIER_SETTINGS_SECTION, /* translators: %1$s: html start, %2$s: html end*/ sprintf( __( '%1$sWebhook Settings%2$s', 'woo-cart-abandonment-recovery' ), '', '' ), array( $this, 'wcf_cart_abandonment_options_callback' ), WCF_CA_PAGE_NAME ); // End: Settings for webhook. // Start: GDPR Settings. add_settings_section( WCF_CA_GDPR_SETTINGS_SECTION, /* translators: %1$s: html start, %2$s: html end*/ sprintf( __( '%1$sGDPR Settings%2$s', 'woo-cart-abandonment-recovery' ), '', '' ), array( $this, 'wcf_cart_abandonment_options_callback' ), WCF_CA_PAGE_NAME ); add_settings_field( 'wcf_ca_gdpr_status', __( 'Enable GDPR Integration', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_gdpr_status_callback' ), WCF_CA_PAGE_NAME, WCF_CA_GDPR_SETTINGS_SECTION, array( __( 'Ask confirmation from the user before tracking data.

Note: By checking this, it will show up confirmation text below the email id on checkout page.', 'woo-cart-abandonment-recovery' ) ) ); add_settings_field( 'wcf_ca_gdpr_message', __( 'GDPR Message', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_gdpr_message_callback' ), WCF_CA_PAGE_NAME, WCF_CA_GDPR_SETTINGS_SECTION, array( '', 'woo-cart-abandonment-recovery' ) ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_gdpr_status' ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_gdpr_message' ); // End: GDPR Settings. // Start: Plugin settings. add_settings_section( WCF_CA_PLUGIN_SETTINGS_SECTION, /* translators: %1$s: html start, %2$s: html end*/ sprintf( __( '%1$sPlugin Settings%2$s', 'woo-cart-abandonment-recovery' ), '', '' ), array( $this, 'wcf_cart_abandonment_options_callback' ), WCF_CA_PAGE_NAME ); register_setting( WCF_CA_SETTINGS_OPTION_GROUP, 'wcf_ca_delete_plugin_data' ); add_settings_field( 'wcf_ca_delete_plugin_data', __( 'Delete Plugin Data', 'woo-cart-abandonment-recovery' ), array( $this, 'wcf_ca_delete_plugin_data_callback' ), WCF_CA_PAGE_NAME, WCF_CA_PLUGIN_SETTINGS_SECTION, array( __( 'Enabling this option will delete the plugin data while deleting the Plugin.', 'woo-cart-abandonment-recovery' ) ) ); } /** * Callback for send recovery report email to admin. * * @param array $args args. * @since 1.1.5 */ public function send_recovery_report_emails_to_admin( $args ) { $email_admin_on_recovery = get_option( 'wcf_ca_send_recovery_report_emails_to_admin', 'on' ); $html = ''; printf( '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for send recovery report email to admin. * * @param array $args args. * @since 1.1.5 */ public function admin_email_callback( $args ) { $wcf_ca_admin_email = get_option( 'wcf_ca_admin_email', get_option( 'admin_email' ) ); $html = ''; printf( '', isset( $wcf_ca_admin_email ) ? esc_attr( $wcf_ca_admin_email ) : '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for add utm param. * * @param array $args args. * @since 1.2.13 */ public function wcar_add_param_to_recovery_url( $args ) { $wcf_ca_global_param = get_option( 'wcf_ca_global_param', false ); $html = ''; printf( '', isset( $wcf_ca_global_param ) ? esc_attr( $wcf_ca_global_param ) : '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment status. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_delete_plugin_data_callback( $args ) { $wcf_ca_delete_plugin_data = get_option( 'wcf_ca_delete_plugin_data' ); $html = ''; printf( '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment status. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_coupon_code_status_callback( $args ) { $wcf_ca_coupon_code_status = get_option( 'wcf_ca_coupon_code_status' ); $html = ''; printf( '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment cut off time. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_zapier_cart_abandoned_webhook_callback( $args ) { $wcf_ca_zapier_cart_abandoned_webhook = get_option( 'wcf_ca_zapier_cart_abandoned_webhook' ); echo ''; echo ''; echo ''; $html = ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment status. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_zapier_tracking_status_callback( $args ) { $wcf_ca_zapier_tracking_status = get_option( 'wcf_ca_zapier_tracking_status' ); $html = ''; printf( '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for send email to admin. * * @param array $args args. * @since 1.1.5 */ public function wcar_email_admin_on_recovery( $args ) { $email_admin_on_recovery = get_option( 'wcar_email_admin_on_recovery' ); $html = ''; printf( '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment cut off time. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_coupon_amount_callback( $args ) { $wcf_ca_coupon_amount = get_option( 'wcf_ca_coupon_amount' ); printf( '', isset( $wcf_ca_coupon_amount ) ? esc_attr( $wcf_ca_coupon_amount ) : '' ); $html = ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment cut off time. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_coupon_expiry_callback( $args ) { $wcf_ca_coupon_expiry = intval( get_option( 'wcf_ca_coupon_expiry' ) ); printf( '', isset( $wcf_ca_coupon_expiry ) ? esc_attr( $wcf_ca_coupon_expiry ) : '' ); $coupon_expiry_unit = get_option( 'wcf_ca_coupon_expiry_unit' ); $items = array( 'hours' => __( 'Hour(s)', 'woo-cart-abandonment-recovery' ), 'days' => __( 'Day(s)', 'woo-cart-abandonment-recovery' ), ); echo "'; $html = ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment cut off time. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_gdpr_message_callback( $args ) { $wcf_ca_gdpr_message = get_option( 'wcf_ca_gdpr_message' ); printf( '', isset( $wcf_ca_gdpr_message ) ? esc_attr( $wcf_ca_gdpr_message ) : '' ); $html = ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment cut off time. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_discount_type_callback( $args ) { $discount_type = get_option( 'wcf_ca_discount_type' ); $items = array( 'percent' => __( 'Percentage discount', 'woo-cart-abandonment-recovery' ), 'fixed_cart' => __( 'Fixed cart discount', 'woo-cart-abandonment-recovery' ), ); echo "'; } /** * Validation for cart abandonment `cut-off` settings. * * @param array $input input. * @since 1.1.5 */ public function wcf_ca_coupon_amount_validation( $input ) { $output = ''; if ( ( is_numeric( $input ) && $input >= 1 ) ) { $output = stripslashes( $input ); } else { add_settings_error( 'wcf_ca_coupon_amount', 'error found', __( 'Coupon code should be numeric and has to be greater than or equals to 1.', 'woo-cart-abandonment-recovery' ) ); } return $output; } /** * Callback for cart abandonment options. * * @since 1.1.5 */ public function wcf_cart_abandonment_options_callback() { echo '
'; } /** * Callback for cart abandonment status. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_status_callback( $args ) { $wcf_ca_status = get_option( 'wcf_ca_status' ); $html = ''; printf( '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for cart abandonment status. * * @param array $args args. * @since 1.1.5 */ public static function wcf_ca_cron_run_time_callback( $args ) { $wcf_ca_cron_run_time = apply_filters( 'woo_ca_update_order_cron_interval', get_option( 'wcf_ca_cron_run_time', 20 ) ); printf( '', esc_attr( $wcf_ca_cron_run_time ) ); $html = ''; echo wp_kses_post( $html ); } /** * Callback for ignore users from tracking cart. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_ignore_users_callback( $args ) { $wcf_ca_ignore_users = get_option( 'wcf_ca_ignore_users' ); $html = ''; $roles_obj = new WP_Roles(); $roles_names_array = $roles_obj->get_names(); $roles_names_array = array_diff( $roles_names_array, array( 'Customer' ) ); ?>

value=""> '; } ?>

' . $args[0] . '
'; echo wp_kses_post( $html ); } /** * Callback for ignore users from tracking cart. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_exclude_orders_callback( $args ) { $wcf_ca_excludes_orders = get_option( 'wcf_ca_excludes_orders', array() ); $html = ''; $order_status = wc_get_order_statuses(); $new_order_status = str_replace( 'wc-', '', array_keys( $order_status ) ); $order_status = array_combine( $new_order_status, $order_status ); $order_status = \array_diff( $order_status, array( 'Refunded', 'Draft', 'Cancelled' ) ); ?>

$value ) { ?> value=""> '; } ?>

' . $args[0] . '
'; echo wp_kses_post( $html ); } /** * Delete coupons. * * @param array $args args. */ public function wcf_ca_auto_delete_coupons_callback( $args ) { $wcf_ca_auto_delete_coupons = get_option( 'wcf_ca_auto_delete_coupons' ); $html = ''; printf( '' ); $html .= ' ' . $args[0] . ''; echo wp_kses_post( $html ); } /** * Delete coupons. * * @param array $args args. */ public function wcf_ca_delete_coupons_callback( $args ) { ?> ' . $args[0] . '
'; echo wp_kses_post( $html ); } /** * Callback for cart abandonment status. * * @param array $args args. * @since 1.1.5 */ public function wcf_ca_gdpr_status_callback( $args ) { $wcf_ca_gdpr_status = get_option( 'wcf_ca_gdpr_status' ); $html = ''; printf( '' ); $html .= ''; echo wp_kses_post( $html ); } /** * Callback for email from name. * * @param array $args Arguments. */ public static function wcf_ca_from_name_callback( $args ) { $wcf_ca_from_name = get_option( 'wcf_ca_from_name' ); printf( '', isset( $wcf_ca_from_name ) ? esc_attr( $wcf_ca_from_name ) : '' ); $html = ''; echo wp_kses_post( $html ); } /** * Callback for email from. * * @param array $args Arguments. */ public static function wcf_ca_from_email_callback( $args ) { $wcf_ca_from_email = get_option( 'wcf_ca_from_email' ); printf( '', isset( $wcf_ca_from_email ) ? esc_attr( $wcf_ca_from_email ) : '' ); $html = ''; echo wp_kses_post( $html ); } /** * Callback for email reply. * * @param array $args Arguments. * @since 3.5 */ public static function wcf_ca_reply_email_callback( $args ) { $wcf_ca_reply_email = get_option( 'wcf_ca_reply_email' ); printf( '', isset( $wcf_ca_reply_email ) ? esc_attr( $wcf_ca_reply_email ) : '' ); $html = ''; echo wp_kses_post( $html ); } /** * Validation for email. * * @param string $input input. * @since 1.1.5 */ public function wcf_ca_report_emails_validation( $input ) { if ( ! empty( $input ) ) { $admin_emails = preg_split( "/[\f\r\n]+/", $input ); $emails_ids = array(); foreach ( $admin_emails as $admin_email ) { if ( is_email( $admin_email ) ) { array_push( $emails_ids, sanitize_email( $admin_email ) ); } } $emails_ids = implode( "\n", $emails_ids ); return $emails_ids; } return $input; } /** * Validation for email. * * @param array $input input. * @since 1.1.5 */ public function wcf_ca_from_email_validation( $input ) { if ( $input && ! is_email( $input ) ) { add_settings_error( 'wcf_ca_from_email', 'error found', __( 'Invalid email "From" address field', 'woo-cart-abandonment-recovery' ) ); } return sanitize_email( $input ); } /** * Validation for reply email. * * @param array $input input. * @since 1.1.5 */ public function wcf_ca_reply_email_validation( $input ) { if ( $input && ! is_email( $input ) ) { add_settings_error( 'wcf_ca_reply_email', 'error found', __( 'Invalid email "Reply" address field', 'woo-cart-abandonment-recovery' ) ); } return sanitize_email( $input ); } /** * Initiator */ public static function get_instance() { if ( ! isset( self::$instance ) ) { self::$instance = new self(); } return self::$instance; } } Cartflows_Ca_Settings::get_instance();