Commit 53c1c508 authored by KR Moorhouse's avatar KR Moorhouse

Updated formatting and functionality of deprecated optin modal. Disabled optin admin notice in 3.0.

parent 2527aa4b
......@@ -157,6 +157,7 @@
<div id="optin-modal" style="display:none;">
<h2>Help make Ninja Forms better!</h2>
......@@ -170,6 +171,36 @@
<span id="optin-spinner" class="spinner"></span>
<button id="optin" class="button-primary" style="margin-bottom: 10px; font-size: 16px;">Yes, I want to make Ninja Forms better!</button> <button id="optout" class="button-secondary" style="margin-bottom: 10px;">No, please don't collect errors or other data.</button>
<div style="display:none;">
<div id="optin-modal-title">
<h2 style="font-size:180%;">Help make Ninja Forms better!</h2>
<div id="optin-modal" style="display:none; padding:5px 15px;">
We would like to collect data about how Ninja Forms is used so that we can improve the experience for everyone. This data will not include ANY submission data or personally identifiable information.
Please check out our <a href="" target="_blank">privacy policy</a> for additional clarification.
<input id="optin-send-email" type="checkbox" style="margin:7px;"><label for="optin-send-email"> Yes, please send me occasional emails about Ninja Forms.</label>
$current_user = wp_get_current_user();
<p id="optin-block" style="padding-top:10px; display:none;">
<input type="text" id="optin-email-address" value="<?php echo $current_user->user_email; ?>" style="width:100%; font-size:16px;">
<span id="optin-spinner" class="spinner"></span>
<div style="padding-top:15px; width:100%; clear:both;">
<button id="optout" class="button-secondary" style="margin-bottom:10px; font-size:18px;">Not Now</button>
<button id="optin" class="button-primary" style="margin-bottom:10px; font-size:18px; float:right;">Yes, I agree!</button>
<div id="optin-thankyou" style="display:none;">
Thank you for opting in!
......@@ -7,10 +7,20 @@ jQuery(document).ready(function($) {
var optinModal = new jBox( 'Modal', {
content: jQuery( '#optin-modal' ),
closeOnEsc: false,
closeOnClick: false
closeOnClick: false,
title: jQuery( '#optin-modal-title' )
} );;
// Show/Hide email field, based on the opt-in checkbox.
jQuery( '#optin-send-email' ).click( function( e ) {
if( jQuery( this ).is( ':checked' ) ) {
jQuery( '#optin-block' ).show();
} else {
jQuery( '#optin-block' ).hide();
} )
jQuery( '#optin' ).click( function( e ) {
var sendEmail;
......@@ -33,7 +33,7 @@ final class NF_Tracking
// Temporary: Report previously opted-in users that were not already reported. @todo Remove after a couple of versions.
add_action( 'admin_init', array( $this, 'report_optin' ) );
add_filter( 'nf_admin_notices', array( $this, 'admin_notice' ) );
// add_filter( 'nf_admin_notices', array( $this, 'admin_notice' ) );
add_filter( 'ninja_forms_check_setting_allow_tracking', array( $this, 'check_setting' ) );
add_filter( 'ninja_forms_update_setting_allow_tracking', array( $this, 'update_setting' ) );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment