Plugin Directory

Changeset 3386480


Ignore:
Timestamp:
10/29/2025 01:53:54 PM (5 months ago)
Author:
krishaweb
Message:

resolving plugin compatibility issue and add new features

Location:
cf7-thank-you-page
Files:
19 added
9 edited

Legend:

Unmodified
Added
Removed
  • cf7-thank-you-page/trunk/assets/css/style.css

    r2655733 r3386480  
    1 .cf7-redirect-wrap .dynamic-url{
     1.cf7-redirect-wrap .dynamic-url {
    22    display: flex;
    33    margin-top: 15px;
     
    99
    1010.cf7-redirect-wrap .divider .spinner.is-active {
    11     margin: 0; 
     11    margin: 0;
    1212}
     13
    1314.cf7-redirect-hidden {
    1415    display: none !important;
     
    1920}
    2021
    21 .enable-redirection {
    22     margin-bottom: 15px;
     22.redirection-option {
     23    display: flex;
     24    gap: 10px;
     25    margin-bottom: 15px;
     26    align-items: center;
    2327}
    2428
     29.cf7-configuration {
     30    display: flex;
     31    gap: 10%;
     32    padding: 5px 0;
     33}
     34
     35.cf7-configuration .cf7-label {
     36    width: 20%;
     37    font-size: 16px;
     38}
     39
     40.cf7-configuration .wp-editor-wrap {
     41    width: 70%;
     42}
     43
     44.toaster-time input[type="number"],
     45.popup-time input[type="number"] {
     46    min-width: 250px;
     47}
  • cf7-thank-you-page/trunk/assets/js/script.js

    r2655733 r3386480  
    11jQuery( document ).ready( function( $ ) {
     2    $('.popup_text_color').wpColorPicker();
     3    $('.popup_bg_color').wpColorPicker();
     4    $('.toaster_text_color').wpColorPicker();
     5    $('.toaster_bg_color').wpColorPicker();
    26    $( document ).on( 'change', '.all_post_types', function() {
    37        $( '.divider' ).html( '<span class="spinner is-active"></span>' );
     
    610            {
    711                action: 'cf7_redirect_action',
    8                 selected_post_type: $( 'select[name="all_posts_type"]' ).val(),
    9                 nonce: cf7_redirect.security_nonce
     12                selected_post_type: $( 'select[name="cf7_redirect_setting[redirect][all_posts_type]"]' ).val(),
     13                nonce: cf7_redirect.security_nonce,
     14                formId: $('#post_ID').val(),
    1015            },
    1116            function( res ) {
    1217                if ( res.status == 1 ) {
    13                     $( 'select[name="all_pages"]' ).html( res.html );
     18                    $( 'select[name="cf7_redirect_setting[redirect][redirect_page]"]' ).html( res.html );
    1419                }
    1520                $( '.divider' ).html( '<span class="dashicons dashicons-arrow-right-alt"></span>' );
     
    2025
    2126    // External url.
    22     $( document ).on( 'change', 'input[name="custom_link"]', function() {
     27    $( document ).on( 'change', 'input[name="cf7_redirect_setting[redirect][use_external_url]"]', function() {
    2328        if ( $( this ).is( ':checked' ) ) {
    2429            $( '.url-textbox' ).removeAttr( 'disabled' ).removeClass( 'cf7-redirect-hidden' );
     
    2934        }
    3035    } );
    31     $( 'input[name="custom_link"]' ).change();
    3236
    3337    // Enable redirection.
    34     $( document ).on( 'change', 'input[name="enable_redirect"]', function() {
    35         if ( $( this ).is( ':checked' ) ) {
    36             $( '.cf7-redirect-url' ).removeAttr( 'disabled' ).removeClass( 'cf7-redirect-hidden' );
     38    $( document ).on( 'change', 'select[name="cf7_redirect_setting[redirection_option]"]', function() {
     39        $selected_container = $(this).val().replace('_', '-');
     40        $('.cf7-options').attr('disabled', true).addClass('cf7-redirect-hidden');
     41        $('.cf7-' + $selected_container).removeAttr('disabled').removeClass('cf7-redirect-hidden');
     42    } );
     43
     44    $(document).on('change', 'input[name="cf7_redirect_setting[popup][confirm_button]"]', function() {
     45        if ( $(this).is(':checked')){
     46            $('.popup-confirm-botton-text').removeClass('cf7-redirect-hidden');
    3747        } else {
    38             $( '.cf7-redirect-url' ).attr( 'disabled', true ).addClass( 'cf7-redirect-hidden' );
     48            $('.popup-confirm-botton-text').addClass('cf7-redirect-hidden');
    3949        }
    40     } );
    41     $( 'input[name="enable_redirect"]' ).change();
     50    });
     51
     52    $(document).on('change', 'input[name="cf7_redirect_setting[popup][close_button]"]', function() {
     53        if ( $(this).is(':checked')){
     54            $('.popup-close-botton-text').removeClass('cf7-redirect-hidden');
     55        } else {
     56            $('.popup-close-botton-text').addClass('cf7-redirect-hidden');
     57        }
     58    });
     59
     60    $(document).on('change', 'input[name="cf7_redirect_setting[popup][timer]"]', function() {
     61        if ( $(this).is(':checked')){
     62            $('.popup-time').removeClass('cf7-redirect-hidden');
     63        } else {
     64            $('.popup-time').addClass('cf7-redirect-hidden');
     65        }
     66    });
     67
     68    $(document).on('change', 'input[name="cf7_redirect_setting[toaster][confirm_button]"]', function() {
     69        if ( $(this).is(':checked')){
     70            $('.toaster-confirm-botton-text').removeClass('cf7-redirect-hidden');
     71        } else {
     72            $('.toaster-confirm-botton-text').addClass('cf7-redirect-hidden');
     73        }
     74    });
     75
     76    $(document).on('change', 'input[name="cf7_redirect_setting[toaster][close_button]"]', function() {
     77        if ( $(this).is(':checked')){
     78            $('.toaster-close-botton-text').removeClass('cf7-redirect-hidden');
     79        } else {
     80            $('.toaster-close-botton-text').addClass('cf7-redirect-hidden');
     81        }
     82    });
     83
     84    $(document).on('change', 'input[name="cf7_redirect_setting[toaster][timer]"]', function() {
     85        if ( $(this).is(':checked')){
     86            $('.toaster-time').removeClass('cf7-redirect-hidden');
     87        } else {
     88            $('.toaster-time').addClass('cf7-redirect-hidden');
     89        }
     90    });
    4291} );
  • cf7-thank-you-page/trunk/cf7-thank-you-page.php

    r2655733 r3386480  
    11<?php
    22/**
    3  * Plugin Name:       CF7 Thank You Page
     3 * Plugin Name:       Page Redirection For CF7
    44 * Plugin URI:
    55 * Description:       Configure CF7 Thank You Page for each form
    6  * Version:           1.0
     6 * Version:           1.1
    77 * Author:            KrishaWeb
    88 * Author URI:        https://www.krishaweb.com/
    99 * Text Domain:       cf7-thank-you-page
    1010 * Domain Path:       /languages
     11 * Requires Plugins:  contact-form-7
     12 * License:                     GPLv3 or later
     13 * License URI:             https://www.gnu.org/licenses/gpl-3.0.html
    1114 *
    1215 * @package           Contact_Form_7_Redirect
     
    1821}
    1922
    20 define( 'CF7_REDIRECT_VERSION', '1.0' );
     23define( 'CF7_REDIRECT_VERSION', '1.1' );
     24define( 'CF7_REDIRECT_FILE', __FILE__ );
     25define( 'CF7_REDIRECT_PATH', plugin_dir_path( __FILE__ ) );
     26define( 'CF7_REDIRECT_URL', plugin_dir_url( __FILE__ ) );
     27define( 'CF7_REDIRECT_BASENAME', plugin_basename( __FILE__ ) );
    2128
    2229// Include File for check contact form is present and active.
  • cf7-thank-you-page/trunk/includes/class-cf7-thank-you-page.php

    r2655733 r3386480  
    2828            }
    2929
     30            // Migrate settings.
     31            $this->migrate_settings();
     32
    3033            // Contact form 7 tab panel.
    3134            add_filter( 'wpcf7_editor_panels', array( $this, 'cf7_redirect_panels' ) );
     
    4245            // Ajax.
    4346            add_action( 'wp_ajax_cf7_redirect_action', array( $this, 'cf7_redirect_select_posts' ) );
    44             add_action( 'wp_ajax_nopriv_cf7_redirect_action', array( $this, 'cf7_redirect_select_posts' ) );
     47
     48            // enqueue frontend script.
     49            add_action( 'wp_enqueue_scripts', array( $this, 'cf7_register_frontend_scripts' ) );
     50            add_action( 'wpcf7_shortcode_callback', array( $this, 'cf7_enqeue_frontend_scripts' ) );
     51
     52            add_action( 'wp_ajax_cf7_redirect_setting', array( $this, 'cf7_redirect_setting' ) );
     53            add_action( 'wp_ajax_nopriv_cf7_redirect_setting', array( $this, 'cf7_redirect_setting' ) );
    4554        }
    4655
     
    6978        public function cf7_redirect_panels( $panels ) {
    7079            $panels['redirect-panels'] = array(
    71                 'title'    => __( 'Redirect to page', 'cf7-thank-you-page' ),
     80                'title'    => __( 'Submission Settings', 'cf7-thank-you-page' ),
    7281                'callback' => array( $this, 'cf7_redirect_panels_callback' ),
    7382            );
     
    8796        public function cf7_redirect_save_form() {
    8897            $cf7_id = (int) filter_input( INPUT_POST, 'post_ID', FILTER_SANITIZE_NUMBER_INT );
    89             if ( isset( $_POST['all_pages'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
    90                 $page_id = (int) filter_input( INPUT_POST, 'all_pages', FILTER_SANITIZE_NUMBER_INT );
    91                 update_post_meta( $cf7_id, 'redirect_page', $page_id );
    92             }
    93             if ( isset( $_POST['all_posts_type'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
    94                 $post_name = isset( $_POST['all_posts_type'] ) ? sanitize_text_field( wp_unslash( $_POST['all_posts_type'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
    95                 update_post_meta( $cf7_id, 'redirect_post_type', $post_name );
    96             }
    97 
    98             $custom_link = isset( $_POST['custom_link'] ) ? 1 : 0; // phpcs:ignore WordPress.Security.NonceVerification.Missing
    99             update_post_meta( $cf7_id, 'use_external_url', $custom_link );
    100 
    101             if ( $custom_link && isset( $_POST['external-url'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
    102                 $external_url = isset( $_POST['external-url'] ) ? sanitize_text_field( wp_unslash( $_POST['external-url'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
    103                 update_post_meta( $cf7_id, 'external_url', $external_url );
    104             } else {
    105                 delete_post_meta( $cf7_id, 'external_url' );
    106             }
    107 
    108             $enable_redirect = isset( $_POST['enable_redirect'] ) ? 1 : 0; // phpcs:ignore WordPress.Security.NonceVerification.Missing
    109             update_post_meta( $cf7_id, 'enable_redirect', $enable_redirect );
     98
     99            if ( isset( $_POST['nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'wpcf7-save-contact-form_' . $cf7_id ) ) {
     100                die( 'Invalid nonce.' );
     101            }
     102
     103            $options = isset( $_POST['cf7_redirect_setting'] ) ? wp_unslash( $_POST['cf7_redirect_setting'] ) : array(); // phpcs:ignore.
     104            $setting = $this->cf7_sanitize_form_field( $options );
     105
     106            foreach ( array( 'popup', 'toaster' ) as $type ) {
     107                if ( ! isset( $setting[ $type ]['time'] ) || ! is_numeric( $setting[ $type ]['time'] ) || 0 > (float) $setting[ $type ]['time'] ) {
     108                    $setting[ $type ]['time'] = 0;
     109                }
     110            }
     111
     112            update_post_meta( $cf7_id, 'cf7_redirect_setting', $setting );
     113        }
     114
     115        /**
     116         * Sanitize the form field.
     117         *
     118         * @param array|string $options form field.
     119         * @return array
     120         */
     121        private function cf7_sanitize_form_field( $options ) {
     122            $setting_options = array();
     123            $editor_fiels    = array( 'title', 'footer', 'confirm_button_text', 'close_button_text' );
     124
     125            foreach ( $options as $key => $option ) {
     126                if ( is_array( $option ) ) {
     127                    $setting_options[ $key ] = $this->cf7_sanitize_form_field( $option );
     128                } elseif ( in_array( $key, $editor_fiels, true ) ) {
     129                        $setting_options[ $key ] = wp_kses_post( $option );
     130                } else {
     131                    $setting_options[ $key ] = sanitize_text_field( $option );
     132                }
     133            }
     134
     135            return $setting_options;
    110136        }
    111137
     
    228254
    229255            // Enqueue js.
    230             wp_enqueue_script( 'cf7-redirect-script', plugin_dir_url( __FILE__ ) . '../assets/js/script.js', array(), CF7_REDIRECT_VERSION, false );
     256            wp_enqueue_editor();
     257            wp_enqueue_script( 'wp-color-picker' );
     258            wp_enqueue_script( 'cf7-redirect-script', plugin_dir_url( __FILE__ ) . '../assets/js/script.js', array( 'wp-color-picker' ), CF7_REDIRECT_VERSION, false );
    231259
    232260            // Ajax.
     
    247275            check_ajax_referer( 'cf7_redirect_get_posts', 'nonce' );
    248276
    249             $option = '<option value="">' . __( '--None--', 'cf7-thank-you-page' ) . '</option>';
     277            $form_id       = isset( $_POST['formId'] ) ? sanitize_text_field( wp_unslash( $_POST['formId'] ) ) : 0;
     278            $setting       = get_post_meta( $form_id, 'cf7_redirect_setting', true );
     279            $selected_post = isset( $setting['redirect']['redirect_page'] ) ? $setting['redirect']['redirect_page'] : '';
     280            $option        = '<option value="">' . __( '--None--', 'cf7-thank-you-page' ) . '</option>';
    250281            if ( isset( $_POST['selected_post_type'] ) && ! empty( $_POST['selected_post_type'] ) ) {
    251282                $cpts = $this->cf7_redirect_get_posts_by_cpt( sanitize_text_field( wp_unslash( $_POST['selected_post_type'] ) ) );
    252283                if ( ! empty( $cpts ) ) {
    253284                    foreach ( $cpts as $cpt ) :
    254                         $option .= '<option value="' . $cpt->ID . '">' . esc_html( ucfirst( $cpt->post_title ) ) . '</option>';
     285                        $option .= '<option value="' . $cpt->ID . '"' . selected( $selected_post, $cpt->ID, false ) . '>' . esc_html( ucfirst( $cpt->post_title ) ) . '</option>';
    255286                    endforeach;
    256287                }
     
    262293                )
    263294            );
    264             exit;
     295        }
     296
     297        /**
     298         * Migrate current settings.
     299         */
     300        private function migrate_settings() {
     301            $current_version      = get_option( 'cf7_thank_you_page_version', false );
     302            $is_different_version = version_compare( CF7_REDIRECT_VERSION, $current_version, '>' );
     303            if ( $is_different_version ) {
     304                $forms = get_posts(
     305                    array(
     306                        'post_type'   => 'wpcf7_contact_form',
     307                        'numberposts' => -1,
     308                        'fields'      => 'ids',
     309                    )
     310                );
     311
     312                if ( ! empty( $forms ) ) {
     313                    foreach ( $forms as $form_id ) {
     314                        $updated_options               = array();
     315                        $options                       = array();
     316                        $options['redirect_page']      = get_post_meta( $form_id, 'redirect_page', true );
     317                        $options['use_external_url']   = get_post_meta( $form_id, 'use_external_url', true );
     318                        $options['external_url']       = get_post_meta( $form_id, 'external_url', true );
     319                        $options['redirect_post_type'] = get_post_meta( $form_id, 'redirect_post_type', true );
     320
     321                        $enable_redirect                       = get_post_meta( $form_id, 'enable_redirect', true );
     322                        $updated_options['redirection_option'] = ! empty( $enable_redirect ) ? 'redirect' : '';
     323                        $updated_options['redirect']           = $options;
     324                        update_post_meta( $form_id, 'cf7_redirect_setting', $updated_options );
     325
     326                        foreach ( $options as $key => $value ) {
     327                            delete_post_meta( $form_id, $key );
     328                        }
     329                    }
     330                }
     331
     332                update_option( 'cf7_thank_you_page_version', CF7_REDIRECT_VERSION );
     333            }
     334        }
     335
     336        /**
     337         * Register the frontend scripts.
     338         */
     339        public function cf7_register_frontend_scripts() {
     340            wp_register_script( 'cf7-sweetalert', CF7_REDIRECT_URL . 'assets/js/sweetalert.js', array( 'jquery' ), CF7_REDIRECT_VERSION, true );
     341            wp_register_script( 'cf7-redirect-frontend', CF7_REDIRECT_URL . 'assets/js/frontend.js', array( 'jquery', 'cf7-sweetalert' ), CF7_REDIRECT_VERSION, true );
     342
     343            wp_localize_script(
     344                'cf7-redirect-frontend',
     345                'redirectObject',
     346                array(
     347                    'ajaxurl' => admin_url( 'admin-ajax.php' ),
     348                    'nonce'   => wp_create_nonce( 'cf7_redirect' ),
     349                )
     350            );
     351        }
     352
     353        /**
     354         * Enqueue frontend scripts.
     355         */
     356        public function cf7_enqeue_frontend_scripts() {
     357            wp_enqueue_script( 'cf7-sweetalert' );
     358            wp_enqueue_script( 'cf7-redirect-frontend' );
     359        }
     360
     361        /**
     362         * Options after form submitted successfully.
     363         */
     364        public function cf7_redirect_setting() {
     365
     366            if ( isset( $_POST['nonce'] ) && ! wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['nonce'] ) ), 'cf7_redirect' ) ) {
     367                die( 'Invalid nonce.' );
     368            }
     369
     370            $form_id = isset( $_POST['formId'] ) ? sanitize_text_field( wp_unslash( $_POST['formId'] ) ) : 0;
     371            $setting = get_post_meta( $form_id, 'cf7_redirect_setting', true );
     372            $option  = isset( $setting['redirection_option'] ) ? $setting['redirection_option'] : '';
     373            $data    = array();
     374            if ( 'redirect' === $option ) {
     375                if ( 'on' === $setting['redirect']['use_external_url'] ) {
     376                    $data['redirect_url'] = isset( $setting['redirect']['external_url'] ) ? $setting['redirect']['external_url'] : '';
     377                } else {
     378                    $data['redirect_url'] = isset( $setting['redirect']['redirect_page'] ) ? get_permalink( $setting['redirect']['redirect_page'] ) : '';
     379                }
     380            } else {
     381                $data = isset( $setting[ $option ] ) ? $setting[ $option ] : array();
     382            }
     383            $data['redirection_option'] = $option;
     384
     385            wp_send_json(
     386                array(
     387                    'status' => 1,
     388                    'data'   => $data,
     389                )
     390            );
    265391        }
    266392    }
  • cf7-thank-you-page/trunk/readme.txt

    r2841486 r3386480  
    1 === CF7 Thank You Page ===
    2 Plugin Name: CF7 Thank You Page
    3 Plugin URI: https://wordpress.org/plugins/cf7-thank-you-page
    4 Contributors: krishaweb, nareshbheda, praful2111
    5 Tags: contact-form-7-redirect, CF7-redirect, redirect-to-thank-you, contact-form-redirect
    6 Requires at least: 5.0
    7 Tested up to: 6.1
    8 Stable tag: 1.0
    9 Copyright: (c) 2012-2022 KrishaWeb Technologies PVT LTD (info@krishaweb.com)
     1=== Page Redirection For CF7 ===
     2Plugin Name: Page Redirection For CF7
     3Plugin URI: https://wordpress.org/plugins/cf7-thank-you-page/
     4Contributors: krishaweb, nareshbheda, praful2111, parthvataliya, vishalmori
     5Tags: redirect cf7, redirect to url, cf7 redirect, thank you page, cf7
     6Requires at least: 6.0
     7Tested up to: 6.8
     8Stable tag: 1.1
     9Copyright: (c) 2012-2025 KrishaWeb Technologies PVT LTD (info@krishaweb.com)
    1010License: GPLv3 or later
    1111License URI: http://www.gnu.org/licenses/gpl-3.0.html
    1212
    13 CF7 Thank You Page helps you to redirect on thank you page after the contact form is submitted successfully.
     13Page Redirection For CF7 helps you to redirect on thank you page after the contact form is submitted successfully.
    1414
    1515== Description ==
    1616
    17 CF7 Thank You Page is used to redirect to thank you page once the form is submitted. Admin can easily select the page from the website or can add the external link to redirect after the successful form submission.
     17Page Redirection For CF7 is used to redirect to thank you page once the form is submitted. Admin can easily select the page from the website or can add the external link to redirect after the successful form submission. Additionally, customizable popups and toasts notification are available to display after form submission. Plugin support for contact form 7 v5.8.1 and later.
    1818
    1919
     
    2121* You can Enable/Disable redirection from the particular form
    2222* Each Contact Form will have it's own redirect URL/Page
     23* Option to show a popup or toast notification after form submission
    2324* You can redirect to Page/Custom Post Type/Custom URL for each Contact Forms built using Contact Form 7 plugin
    2425* You can add any third-party URL for any campaign[Like - /?utm_source=repo&utm_medium=cf7rl&utm_campaign=readme]
     
    2829> 1. Sign in to your WordPress site as an administrator.
    2930> 2. In the main menu go to Plugins -> Add New.
    30 > 3. Search for CF7 Thank You Page and click install or download and upload the plugin to the /wp-content/plugins/.
     31> 3. Search for Page Redirection For CF7 and click install or download and upload the plugin to the /wp-content/plugins/.
    3132> 4. Activate the plugin through the 'Plugins' menu in WordPress
    3233
     
    5455
    5556== Changelog ==
     57= 1.1 =
     58 - Added feature to show popup and toaster notification after form submission
     59 - Added support for contact form 7 v5.8.1 and later
     60
    5661= 1.0 =
    5762* Initial Release
  • cf7-thank-you-page/trunk/templates/redirect-setting-page.php

    r2655733 r3386480  
    77 */
    88
    9 // phpcs:disable Generic.Formatting.MultipleStatementAlignment.NotSameWarning
    10 $cf7_id        = isset( $_GET['post'] ) ? (int) $_GET['post'] : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    11 $selected_page = get_post_meta( $cf7_id, 'redirect_page', true );
    12 
    13 $selected_post_type = get_post_meta( $cf7_id, 'redirect_post_type', true );
    14 $selected_post_type = ! empty( $selected_post_type ) ? $selected_post_type : 'page';
     9if ( ! defined( 'ABSPATH' ) ) {
     10    exit; // Exit if accessed directly.
     11}
     12
     13$cf7_id             = isset( $_GET['post'] ) ? (int) $_GET['post'] : 0; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
     14$redirect_options   = get_post_meta( $cf7_id, 'cf7_redirect_setting', true );
     15$enable_option      = isset( $redirect_options['redirection_option'] ) ? $redirect_options['redirection_option'] : '';
     16$selected_page      = isset( $redirect_options['redirect']['redirect_page'] ) ? $redirect_options['redirect']['redirect_page'] : '';
     17$selected_post_type = isset( $redirect_options['redirect']['all_posts_type'] ) ? $redirect_options['redirect']['all_posts_type'] : 'page';
    1518$get_posts          = $this->cf7_redirect_get_posts_by_cpt( $selected_post_type );
    16 
    17 $checked = get_post_meta( $cf7_id, 'use_external_url', true );
    18 $external_url = get_post_meta( $cf7_id, 'external_url', true );
    19 $enable_redirect = get_post_meta( $cf7_id, 'enable_redirect', true );
     19$use_external_url   = isset( $redirect_options['redirect']['use_external_url'] ) ? 'on' === $redirect_options['redirect']['use_external_url'] : false;
     20$external_url       = isset( $redirect_options['redirect']['external_url'] ) ? $redirect_options['redirect']['external_url'] : '';
     21$popup_message      = isset( $redirect_options['popup']['message'] ) ? $redirect_options['popup']['message'] : '';
     22$toaster_message    = isset( $redirect_options['toaster']['message'] ) ? $redirect_options['toaster']['message'] : '';
     23
    2024$get_post_types = get_post_types(
    2125    array(
     
    2529unset( $get_post_types['attachment'] );
    2630$get_post_types = array_filter( $get_post_types );
     31
     32// Popup settings.
     33$popup_icon       = isset( $redirect_options['popup']['icon'] ) ? $redirect_options['popup']['icon'] : '';
     34$popup_confirm    = isset( $redirect_options['popup']['confirm_button'] ) ? 'on' === $redirect_options['popup']['confirm_button'] : false;
     35$popup_close      = isset( $redirect_options['popup']['close_button'] ) ? 'on' === $redirect_options['popup']['close_button'] : false;
     36$popup_timer      = isset( $redirect_options['popup']['timer'] ) ? 'on' === $redirect_options['popup']['timer'] : false;
     37$popup_time       = isset( $redirect_options['popup']['time'] ) ? (int) $redirect_options['popup']['time'] : 0;
     38$popup_text_color = isset( $redirect_options['popup']['text_color'] ) ? $redirect_options['popup']['text_color'] : '#757575';
     39$popup_bg_color   = isset( $redirect_options['popup']['bg_color'] ) ? $redirect_options['popup']['bg_color'] : '#ffffff';
     40
     41$popup_title_content   = isset( $redirect_options['popup']['title'] ) ? $redirect_options['popup']['title'] : '';
     42$popup_title_editor_id = 'popup_title';
     43$popup_title_settings  = array(
     44    'textarea_name' => 'cf7_redirect_setting[popup][title]',
     45    'textarea_rows' => 5,
     46    'media_buttons' => false,
     47    'tinymce'       => array(
     48        'toolbar1' => 'formatselect,bold,italic,underline,link,undo,redo',
     49    ),
     50);
     51
     52$popup_footer_content   = isset( $redirect_options['popup']['footer'] ) ? $redirect_options['popup']['footer'] : '';
     53$popup_footer_editor_id = 'popup_footer';
     54$popup_footer_settings  = array(
     55    'textarea_name' => 'cf7_redirect_setting[popup][footer]',
     56    'textarea_rows' => 5,
     57    'media_buttons' => false,
     58    'tinymce'       => array(
     59        'toolbar1' => 'formatselect,bold,italic,underline,link,undo,redo',
     60    ),
     61);
     62
     63$popup_confirm_button_content   = isset( $redirect_options['popup']['confirm_button_text'] ) ? $redirect_options['popup']['confirm_button_text'] : '';
     64$popup_confirm_button_editor_id = 'popup_confirm_button';
     65$popup_confirm_button_settings  = array(
     66    'textarea_name' => 'cf7_redirect_setting[popup][confirm_button_text]',
     67    'textarea_rows' => 5,
     68    'media_buttons' => false,
     69    'tinymce'       => array(
     70        'toolbar1' => 'formatselect,bold,italic,underline,link,undo,redo',
     71    ),
     72);
     73
     74$popup_close_button_content   = isset( $redirect_options['popup']['close_button_text'] ) ? $redirect_options['popup']['close_button_text'] : '';
     75$popup_close_button_editor_id = 'popup_close_button';
     76$popup_close_button_settings  = array(
     77    'textarea_name' => 'cf7_redirect_setting[popup][close_button_text]',
     78    'textarea_rows' => 5,
     79    'media_buttons' => false,
     80    'tinymce'       => array(
     81        'toolbar1' => 'formatselect,bold,italic,underline,link,undo,redo',
     82    ),
     83);
     84
     85// Toaster settings.
     86$toaster_icon       = isset( $redirect_options['toaster']['icon'] ) ? $redirect_options['toaster']['icon'] : '';
     87$toaster_position   = isset( $redirect_options['toaster']['position'] ) ? $redirect_options['toaster']['position'] : '';
     88$toaster_confirm    = isset( $redirect_options['toaster']['confirm_button'] ) ? 'on' === $redirect_options['toaster']['confirm_button'] : false;
     89$toaster_close      = isset( $redirect_options['toaster']['close_button'] ) ? 'on' === $redirect_options['toaster']['close_button'] : false;
     90$toaster_timer      = isset( $redirect_options['toaster']['timer'] ) ? 'on' === $redirect_options['toaster']['timer'] : false;
     91$toaster_time       = isset( $redirect_options['toaster']['time'] ) ? (int) $redirect_options['toaster']['time'] : 0;
     92$toaster_text_color = isset( $redirect_options['toaster']['text_color'] ) ? $redirect_options['toaster']['text_color'] : '#757575';
     93$toaster_bg_color   = isset( $redirect_options['toaster']['bg_color'] ) ? $redirect_options['toaster']['bg_color'] : '#ffffff';
     94
     95$toaster_title_content   = isset( $redirect_options['toaster']['title'] ) ? $redirect_options['toaster']['title'] : '';
     96$toaster_title_editor_id = 'toaster_title';
     97$toaster_title_settings  = array(
     98    'textarea_name' => 'cf7_redirect_setting[toaster][title]',
     99    'textarea_rows' => 5,
     100    'media_buttons' => false,
     101    'tinymce'       => array(
     102        'toolbar1' => 'formatselect,bold,italic,underline,link,undo,redo',
     103    ),
     104);
     105
     106$toaster_footer_content = isset( $redirect_options['toaster']['footer'] ) ? $redirect_options['toaster']['footer'] : '';
     107
     108$toaster_footer_editor_id = 'toaster_footer';
     109$toaster_footer_settings  = array(
     110    'textarea_name' => 'cf7_redirect_setting[toaster][footer]',
     111    'textarea_rows' => 5,
     112    'media_buttons' => false,
     113    'tinymce'       => array(
     114        'toolbar1' => 'formatselect,bold,italic,underline,link,undo,redo',
     115    ),
     116);
     117
     118$toaster_confirm_button_content = isset( $redirect_options['toaster']['confirm_button_text'] ) ? $redirect_options['toaster']['confirm_button_text'] : '';
     119
     120$toaster_confirm_button_editor_id = 'toaster_confirm_button';
     121$toaster_confirm_button_settings  = array(
     122    'textarea_name' => 'cf7_redirect_setting[toaster][confirm_button_text]',
     123    'textarea_rows' => 5,
     124    'media_buttons' => false,
     125    'tinymce'       => array(
     126        'toolbar1' => 'formatselect,bold,italic,underline,link,undo,redo',
     127    ),
     128);
     129
     130$toaster_close_button_content = isset( $redirect_options['toaster']['close_button_text'] ) ? $redirect_options['toaster']['close_button_text'] : '';
     131
     132$toaster_close_button_editor_id = 'toaster_close_button';
     133$toaster_close_button_settings  = array(
     134    'textarea_name' => 'cf7_redirect_setting[toaster][close_button_text]',
     135    'textarea_rows' => 5,
     136    'media_buttons' => false,
     137    'tinymce'       => array(
     138        'toolbar1' => 'formatselect,bold,italic,underline,link,undo,redo',
     139    ),
     140);
    27141?>
    28142<div class="cf7-redirect-wrap">
    29     <div class="enable-redirection">
    30         <input type="checkbox" name="enable_redirect" <?php checked( 1, $enable_redirect ); ?>>
    31         <label><?php esc_html_e( 'Enable redirection.', 'cf7-thank-you-page' ); ?></label>
     143    <div class="redirection-option">
     144        <label for="submission-options"><?php esc_html_e( 'Enable Option: ', 'cf7-thank-you-page' ); ?></label>
     145        <select name="cf7_redirect_setting[redirection_option]" id="after-submission-option">
     146            <option value="">--<?php esc_html_e( 'None', 'cf7-thank-you-page' ); ?>--</option>
     147            <option value="redirect" <?php selected( $enable_option, 'redirect' ); ?>><?php esc_html_e( 'Redirection', 'cf7-thank-you-page' ); ?></option>
     148            <option value="popup" <?php selected( $enable_option, 'popup' ); ?>><?php esc_html_e( 'Popup', 'cf7-thank-you-page' ); ?></option>
     149            <option value="toaster" <?php selected( $enable_option, 'toaster' ); ?>><?php esc_html_e( 'Toaster', 'cf7-thank-you-page' ); ?></option>
     150        </select>
    32151    </div>
    33     <div class="cf7-redirect-url cf7-redirect-hidden">
     152    <div class=" cf7-options cf7-redirect <?php echo esc_attr( 'redirect' !== $enable_option ? 'cf7-redirect-hidden' : '' ); ?>">
     153            <div class="redirect-heading">
     154                <h2><?php esc_html_e( 'Redirection Configuration', 'cf7-thank-you-page' ); ?></h2>
     155            </div>
     156            <hr>
    34157        <div class="external-url">
    35             <input type="checkbox" name="custom_link"<?php checked( $checked, 1 ); ?>><label> <?php esc_html_e( 'Use external URL?', 'cf7-thank-you-page' ); ?></label>
    36             <input type="text" name="external-url" class="cf7-redirect-hidden url-textbox" placeholder="<?php esc_attr_e( 'Enter url', 'cf7-thank-you-page' ); ?>" value="<?php echo ! empty( $external_url ) ? esc_attr( $external_url ) : ''; ?>" required>
    37         </div>
    38         <div class="dynamic-url">
     158            <label>
     159                <input type="checkbox" name="cf7_redirect_setting[redirect][use_external_url]"<?php checked( $use_external_url, 1 ); ?>>
     160                <?php esc_html_e( 'Use external URL?', 'cf7-thank-you-page' ); ?>
     161            </label>
     162            <input type="text" name="cf7_redirect_setting[redirect][external_url]" class="<?php echo esc_attr( $use_external_url ? '' : 'cf7-redirect-hidden' ); ?> url-textbox" placeholder="<?php esc_attr_e( 'Enter url', 'cf7-thank-you-page' ); ?>" value="<?php echo ! empty( $external_url ) ? esc_attr( $external_url ) : ''; ?>">
     163        </div>
     164        <div class="dynamic-url <?php echo esc_attr( $use_external_url ? 'cf7-redirect-hidden' : '' ); ?>">
    39165            <label> <?php esc_html_e( 'Select post type : ', 'cf7-thank-you-page' ); ?>
    40             <select name="all_posts_type" class="all_post_types">
     166            <select name="cf7_redirect_setting[redirect][all_posts_type]" class="all_post_types">
    41167                <?php foreach ( $get_post_types as $slug => $name ) : ?>
    42168                    <option value="<?php echo esc_attr( $slug ); ?>"<?php selected( $selected_post_type, $slug ); ?>><?php echo esc_html( ucfirst( $name ) ); ?></option>
     
    44170            </select></label>
    45171            <div class="divider"><span class="dashicons dashicons-arrow-right-alt"></span></div>
    46             <select name="all_pages">
     172            <select name="cf7_redirect_setting[redirect][redirect_page]">
    47173                <option value=""><?php esc_html_e( '--None--', 'cf7-thank-you-page' ); ?></option>
    48174                <?php
     
    58184        </div>
    59185    </div>
     186    <div class="cf7-options cf7-toaster <?php echo esc_attr( 'toaster' !== $enable_option ? 'cf7-redirect-hidden' : '' ); ?>">
     187        <div class="toaster-heading">
     188            <h2><?php esc_html_e( 'Toaster Configuration', 'cf7-thank-you-page' ); ?></h2>
     189        </div>
     190        <hr>
     191        <div class="toaster-configuration">
     192            <div class="cf7-configuration toaster-icon">
     193                <label class="cf7-label" for="icon"><?php esc_html_e( 'Icon', 'cf7-thank-you-page' ); ?></label>
     194                <select name="cf7_redirect_setting[toaster][icon]" class="toaster_icon">
     195                    <option value="success" <?php selected( $toaster_icon, 'success' ); ?>><?php esc_html_e( 'Success', 'cf7-thank-you-page' ); ?></option>
     196                    <option value="error" <?php selected( $toaster_icon, 'error' ); ?>><?php esc_html_e( 'Error', 'cf7-thank-you-page' ); ?></option>
     197                    <option value="warning" <?php selected( $toaster_icon, 'warning' ); ?>><?php esc_html_e( 'Warning', 'cf7-thank-you-page' ); ?></option>
     198                    <option value="info" <?php selected( $toaster_icon, 'info' ); ?>><?php esc_html_e( 'Info', 'cf7-thank-you-page' ); ?></option>
     199                    <option value="question" <?php selected( $toaster_icon, 'question' ); ?>><?php esc_html_e( 'Question', 'cf7-thank-you-page' ); ?></option>
     200                </select>
     201            </div>
     202            <div class="cf7-configuration toaster-position">
     203                <label class="cf7-label" for="position"><?php esc_html_e( 'Position', 'cf7-thank-you-page' ); ?></label>
     204                <select name="cf7_redirect_setting[toaster][position]" class="toaster_position">
     205                    <option value="top" <?php selected( $toaster_position, 'top' ); ?>><?php esc_html_e( 'Top', 'cf7-thank-you-page' ); ?></option>
     206                    <option value="top-start" <?php selected( $toaster_position, 'top-start' ); ?>><?php esc_html_e( 'Top Start', 'cf7-thank-you-page' ); ?></option>
     207                    <option value="top-end" <?php selected( $toaster_position, 'top-end' ); ?>><?php esc_html_e( 'Top End', 'cf7-thank-you-page' ); ?></option>
     208                    <option value="center" <?php selected( $toaster_position, 'center' ); ?>><?php esc_html_e( 'Center', 'cf7-thank-you-page' ); ?></option>
     209                    <option value="center-start" <?php selected( $toaster_position, 'center-start' ); ?>><?php esc_html_e( 'Center Start', 'cf7-thank-you-page' ); ?></option>
     210                    <option value="center-end" <?php selected( $toaster_position, 'center-end' ); ?>><?php esc_html_e( 'Center End', 'cf7-thank-you-page' ); ?></option>
     211                    <option value="bottom" <?php selected( $toaster_position, 'bottom' ); ?>><?php esc_html_e( 'Bottom', 'cf7-thank-you-page' ); ?></option>
     212                    <option value="bottom-start" <?php selected( $toaster_position, 'bottom-start' ); ?>><?php esc_html_e( 'Bottom Start', 'cf7-thank-you-page' ); ?></option>
     213                    <option value="bottom-end" <?php selected( $toaster_position, 'bottom-end' ); ?>><?php esc_html_e( 'Bottom End', 'cf7-thank-you-page' ); ?></option>
     214
     215                </select>
     216            </div>
     217            <div class="cf7-configuration toaster-title">
     218                <label class="cf7-label" for="title"><?php esc_html_e( 'Title', 'cf7-thank-you-page' ); ?></label>
     219                <?php wp_editor( $toaster_title_content, $toaster_title_editor_id, $toaster_title_settings ); ?>
     220            </div>
     221            <div class="cf7-configuration toaster-message">
     222                <label class="cf7-label" for="message"><?php esc_html_e( 'Message', 'cf7-thank-you-page' ); ?></label>
     223                <textarea rows="5" cols="40" name="cf7_redirect_setting[toaster][message]" class="toaster-message-textbox" placeholder="<?php esc_attr_e( 'Enter message', 'cf7-thank-you-page' ); ?>"><?php echo esc_html( $toaster_message ); ?></textarea>
     224            </div>
     225            <div class="cf7-configuration toaster-text-color">
     226                <label class="cf7-label" for="text-color"><?php esc_html_e( 'Text Color', 'cf7-thank-you-page' ); ?></label>
     227                <input type="text" name="cf7_redirect_setting[toaster][text_color]" value="<?php echo esc_attr( $toaster_text_color ); ?>" class="toaster_text_color">
     228            </div>
     229            <div class="cf7-configuration toaster-bg-color">
     230                <label class="cf7-label" for="bg-color"><?php esc_html_e( 'Background Color', 'cf7-thank-you-page' ); ?></label>
     231                <input type="text" name="cf7_redirect_setting[toaster][bg_color]" value="<?php echo esc_attr( $toaster_bg_color ); ?>" class="toaster_bg_color">
     232            </div>
     233            <div class="cf7-configuration toaster-footer">
     234                <label class="cf7-label cf7-toaster-footer" for="close-botton"><?php esc_html_e( 'Footer', 'cf7-thank-you-page' ); ?></label>
     235                <?php wp_editor( $toaster_footer_content, $toaster_footer_editor_id, $toaster_footer_settings ); ?>
     236            </div>
     237            <div class="cf7-configuration toaster-confirm-botton">
     238                <label class="cf7-label" for="confirm-botton"><?php esc_html_e( 'Confirm Button', 'cf7-thank-you-page' ); ?></label>
     239                <label>
     240                    <input type="checkbox" name="cf7_redirect_setting[toaster][confirm_button]" value="on" class="toaster_confirm_button" <?php echo esc_attr( $toaster_confirm ? 'checked' : '' ); ?>>
     241                    <?php esc_html_e( 'Enable', 'cf7-thank-you-page' ); ?>
     242                </label>
     243            </div>
     244            <div class="cf7-configuration toaster-confirm-botton-text <?php echo esc_attr( $toaster_confirm ? '' : 'cf7-redirect-hidden' ); ?>">
     245                <label class="cf7-label" for="confirm-botton"><?php esc_html_e( 'Confirm Button Text', 'cf7-thank-you-page' ); ?></label>
     246                <?php wp_editor( $toaster_confirm_button_content, $toaster_confirm_button_editor_id, $toaster_confirm_button_settings ); ?>
     247            </div>
     248            <div class="cf7-configuration toaster-close-botton">
     249                <label class="cf7-label" for="close-botton"><?php esc_html_e( 'Close Button', 'cf7-thank-you-page' ); ?></label>
     250                <label>
     251                    <input type="checkbox" name="cf7_redirect_setting[toaster][close_button]" value="on" class="toaster_close_button" <?php echo esc_attr( $toaster_close ? 'checked' : '' ); ?>>
     252                    <?php esc_html_e( 'Enable', 'cf7-thank-you-page' ); ?>
     253                </label>
     254            </div>
     255            <div class="cf7-configuration toaster-close-botton-text <?php echo esc_attr( $toaster_close ? '' : 'cf7-redirect-hidden' ); ?>">
     256                <label class="cf7-label" for="close-botton"><?php esc_html_e( 'Close Button Text', 'cf7-thank-you-page' ); ?></label>
     257                <?php wp_editor( $toaster_close_button_content, $toaster_close_button_editor_id, $toaster_close_button_settings ); ?>
     258            </div>
     259            <div class="cf7-configuration toaster-timer">
     260                <label class="cf7-label" for="timer"><?php esc_html_e( 'Timer', 'cf7-thank-you-page' ); ?></label>
     261                <label>
     262                    <input type="checkbox" name="cf7_redirect_setting[toaster][timer]" value="on" class="toaster_timer" <?php echo esc_attr( $toaster_timer ? 'checked' : '' ); ?>>
     263                    <?php esc_html_e( 'Enable', 'cf7-thank-you-page' ); ?>
     264                </label>
     265            </div>
     266            <div class="cf7-configuration toaster-time <?php echo esc_attr( $toaster_timer ? '' : 'cf7-redirect-hidden' ); ?>">
     267                <label class="cf7-label" for="timer"><?php esc_html_e( 'Time (seconds)', 'cf7-thank-you-page' ); ?></label>
     268                <input type="number" name="cf7_redirect_setting[toaster][time]" min="0" placeholder="Enter number in seconds" value="<?php echo esc_attr( $toaster_time ); ?>">
     269            </div>
     270        </div>
     271    </div>
     272    <div class="cf7-options cf7-popup <?php echo esc_attr( 'popup' !== $enable_option ? 'cf7-redirect-hidden' : '' ); ?>">
     273        <div class="toaster-heading">
     274            <h2><?php esc_html_e( 'Popup Configuration', 'cf7-thank-you-page' ); ?></h2>
     275        </div>
     276        <hr>
     277        <div class="popup-configuration">
     278            <div class="cf7-configuration popup-icon">
     279                <label class="cf7-label" for="icon"><?php esc_html_e( 'Icon', 'cf7-thank-you-page' ); ?></label>
     280                <select name="cf7_redirect_setting[popup][icon]" class="popup_icon">
     281                    <option value="success" <?php selected( $popup_icon, 'success' ); ?>><?php esc_html_e( 'Success', 'cf7-thank-you-page' ); ?></option>
     282                    <option value="error" <?php selected( $popup_icon, 'error' ); ?>><?php esc_html_e( 'Error', 'cf7-thank-you-page' ); ?></option>
     283                    <option value="warning" <?php selected( $popup_icon, 'warning' ); ?>><?php esc_html_e( 'Warning', 'cf7-thank-you-page' ); ?></option>
     284                    <option value="info" <?php selected( $popup_icon, 'info' ); ?>><?php esc_html_e( 'Info', 'cf7-thank-you-page' ); ?></option>
     285                    <option value="question" <?php selected( $popup_icon, 'question' ); ?>><?php esc_html_e( 'Question', 'cf7-thank-you-page' ); ?></option>
     286                </select>
     287            </div>
     288            <div class="cf7-configuration popup-title">
     289                <label class="cf7-label" for="title"><?php esc_html_e( 'Title', 'cf7-thank-you-page' ); ?></label>
     290                <?php wp_editor( $popup_title_content, $popup_title_editor_id, $popup_title_settings ); ?>
     291            </div>
     292            <div class="cf7-configuration popup-message">
     293                <label class="cf7-label" for="message"><?php esc_html_e( 'Message', 'cf7-thank-you-page' ); ?></label>
     294                <textarea rows="5" cols="40" name="cf7_redirect_setting[popup][message]" class="popup-message-textbox" placeholder="<?php esc_attr_e( 'Enter message', 'cf7-thank-you-page' ); ?>"><?php echo esc_html( $popup_message ); ?></textarea>
     295            </div>
     296            <div class="cf7-configuration popup-text-color">
     297                <label class="cf7-label" for="text-color"><?php esc_html_e( 'Text Color', 'cf7-thank-you-page' ); ?></label>
     298                <input type="text" name="cf7_redirect_setting[popup][text_color]" value="<?php echo esc_attr( $popup_text_color ); ?>" class="popup_text_color">
     299            </div>
     300            <div class="cf7-configuration popup-bg-color">
     301                <label class="cf7-label" for="bg-color"><?php esc_html_e( 'Background Color', 'cf7-thank-you-page' ); ?></label>
     302                <input type="text" name="cf7_redirect_setting[popup][bg_color]" value="<?php echo esc_attr( $popup_bg_color ); ?>" class="popup_bg_color">
     303            </div>
     304            <div class="cf7-configuration popup-footer">
     305                <label class="cf7-label cf7-popup-footer" for="close-botton"><?php esc_html_e( 'Footer', 'cf7-thank-you-page' ); ?></label>
     306                <?php wp_editor( $popup_footer_content, $popup_footer_editor_id, $popup_footer_settings ); ?>
     307            </div>
     308            <div class="cf7-configuration popup-confirm-botton">
     309                <label class="cf7-label" for="confirm-botton"><?php esc_html_e( 'Confirm Button', 'cf7-thank-you-page' ); ?></label>
     310                <label>
     311                    <input type="checkbox" name="cf7_redirect_setting[popup][confirm_button]" value="on" class="popup_confirm_button" <?php echo esc_attr( $popup_confirm ? 'checked' : '' ); ?>>
     312                    <?php esc_html_e( 'Enable', 'cf7-thank-you-page' ); ?>
     313                </label>
     314            </div>
     315            <div class="cf7-configuration popup-confirm-botton-text <?php echo esc_attr( $popup_confirm ? '' : 'cf7-redirect-hidden' ); ?>">
     316                <label class="cf7-label" for="confirm-botton"><?php esc_html_e( 'Confirm Button Text', 'cf7-thank-you-page' ); ?></label>
     317                <?php wp_editor( $popup_confirm_button_content, $popup_confirm_button_editor_id, $popup_confirm_button_settings ); ?>
     318            </div>
     319            <div class="cf7-configuration popup-close-botton">
     320                <label class="cf7-label" for="close-botton"><?php esc_html_e( 'Close Button', 'cf7-thank-you-page' ); ?></label>
     321                <label>
     322                    <input type="checkbox" name="cf7_redirect_setting[popup][close_button]" value="on" class="popup_close_button" <?php echo esc_attr( $popup_close ? 'checked' : '' ); ?>>
     323                    <?php esc_html_e( 'Enable', 'cf7-thank-you-page' ); ?>
     324                </label>
     325            </div>
     326            <div class="cf7-configuration popup-close-botton-text <?php echo esc_attr( $popup_close ? '' : 'cf7-redirect-hidden' ); ?>">
     327                <label class="cf7-label" for="close-botton"><?php esc_html_e( 'Close Button Text', 'cf7-thank-you-page' ); ?></label>
     328                <?php wp_editor( $popup_close_button_content, $popup_close_button_editor_id, $popup_close_button_settings ); ?>
     329            </div>
     330            <div class="cf7-configuration popup-timer">
     331                <label class="cf7-label" for="timer"><?php esc_html_e( 'Timer', 'cf7-thank-you-page' ); ?></label>
     332                <label>
     333                    <input type="checkbox" name="cf7_redirect_setting[popup][timer]" value="on" class="popup_timer" <?php echo esc_attr( $popup_timer ? 'checked' : '' ); ?>>
     334                    <?php esc_html_e( 'Enable', 'cf7-thank-you-page' ); ?>
     335                </label>
     336            </div>
     337            <div class="cf7-configuration popup-time <?php echo esc_attr( $popup_timer ? '' : 'cf7-redirect-hidden' ); ?>">
     338                <label class="cf7-label" for="timer"><?php esc_html_e( 'Time (seconds)', 'cf7-thank-you-page' ); ?></label>
     339                <input type="number" name="cf7_redirect_setting[popup][time]" min="0" placeholder="Enter number in seconds" value="<?php echo esc_attr( $popup_time ); ?>">
     340            </div>
     341        </div>
     342    </div>
    60343</div>
Note: See TracChangeset for help on using the changeset viewer.