From 91530246c5890494cc5334bbfce68d96368d7308 Mon Sep 17 00:00:00 2001 From: Samyog subedi Date: Fri, 27 Dec 2024 10:12:41 +0545 Subject: [PATCH] disable submit in preview --- includes/admin/class-ur-admin-form-preview.php | 8 ++++---- templates/form-registration.php | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/admin/class-ur-admin-form-preview.php b/includes/admin/class-ur-admin-form-preview.php index 375c4a448..53e2dd237 100644 --- a/includes/admin/class-ur-admin-form-preview.php +++ b/includes/admin/class-ur-admin-form-preview.php @@ -42,7 +42,7 @@ public static function add_menu() { public static function welcome_page() { wp_register_script( 'ur-form-preview-tooltipster', UR()->plugin_url() . '/assets/js/tooltipster/tooltipster.bundle.js', array( 'jquery' ), UR()->version, true ); wp_register_script( 'ur-form-preview-copy', UR()->plugin_url() . '/assets/js/admin/ur-copy.js', array( 'jquery' ), UR()->version, true ); - wp_register_script( 'ur-form-preview-admin-script', UR()->plugin_url() . '/assets/js/admin/admin.js', array( 'wp-element', 'wp-blocks', 'wp-editor' ), UR()->version, true ); + wp_register_script( 'ur-form-preview-admin-script', UR()->plugin_url() . '/assets/js/admin/admin.js', array( 'wp-element', 'wp-blocks', 'wp-editor' ), UR()->version ); wp_register_style( 'ur-form-preview-admin-style', UR()->plugin_url() . '/assets/css/admin.css', array(), UR()->version ); wp_register_style( 'ur-form-preview-default-style', UR()->plugin_url() . '/assets/css/user-registration.css', array(), UR()->version ); wp_register_style( 'ur-form-preview-smallscreens', UR()->plugin_url() . '/assets/css/user-registration-smallscreen.css', array(), UR()->version ); @@ -65,7 +65,7 @@ public static function welcome_page() { array( 'ajax_url' => admin_url( 'admin-ajax.php' ), 'form_preview_nonce' => wp_create_nonce( 'ur_form_preview_nonce' ), - 'pro_upgrade_link' => 'https://wpeverest.com/wordpress-plugins/user-registration/?utm_source=plugin&utm_medium=form-preview&utm_campaign=pro-upgrade', + 'pro_upgrade_link' => esc_url('https://wpuserregistration.com/pricing/?utm_source=form-preview&utm_medium=sidebar-upgrade-button&utm_campaign=' . UR()->utm_campaign), ) ); @@ -74,7 +74,7 @@ public static function welcome_page() { ob_start(); self::form_preview_header(); self::form_preview_body(); - self::setup_wizard_footer(); + self::form_preview_footer(); exit; } } @@ -187,7 +187,7 @@ public static function form_preview_body() { * * @since 1.0.0 */ - public static function setup_wizard_footer() { + public static function form_preview_footer() { if ( function_exists( 'wp_print_media_templates' ) ) { wp_print_media_templates(); } diff --git a/templates/form-registration.php b/templates/form-registration.php index 064c615de..dd13db0d7 100644 --- a/templates/form-registration.php +++ b/templates/form-registration.php @@ -295,8 +295,10 @@ $condition_submit_settings = ur_maybe_unserialize( get_post_meta( $form_id, 'user_registration_submit_condition', true ) ); $submit_btn_class = array_merge( $submit_btn_class, (array) ur_get_form_setting_by_key( $form_id, 'user_registration_form_setting_form_submit_class' ) ); + $disabled = isset($_GET['page']) && 'ur_form_preview' === $_GET['page'] ? 'disabled' : ''; + $css = $disabled ? 'cursor: not-allowed;' : ''; ?> -