consent-check-view.php
46 lines
| 1 | |
| 2 | <style> |
| 3 | .wp-social-user-consent-for-banner{ |
| 4 | margin: 0 0 15px 0!important; |
| 5 | width: 842px; |
| 6 | max-width: 1350px; |
| 7 | } |
| 8 | .wp-social-success-notice { |
| 9 | position: fixed; |
| 10 | top: 50px; |
| 11 | right: 20px; |
| 12 | background-color: #14c87c; |
| 13 | color: white; |
| 14 | padding: 10px; |
| 15 | border-radius: 5px; |
| 16 | display: none; |
| 17 | } |
| 18 | |
| 19 | </style> |
| 20 | <script> |
| 21 | jQuery(document).ready(function ($) { |
| 22 | "use strict"; |
| 23 | $('#wp-social-admin-switch__wp-social-user-consent-for-banner').on('change', function(){ |
| 24 | let val = ($(this).prop("checked") ? $(this).val() : 'no'); |
| 25 | let data = { |
| 26 | 'wp_social_user_consent_for_promotional_content' : val, |
| 27 | 'nonce': "<?php echo esc_html(wp_create_nonce( 'ajax-nonce' )); ?>" |
| 28 | }; |
| 29 | |
| 30 | $.post( ajaxurl + '?action=wp_social_admin_consent_action', data, function( data ) { |
| 31 | $('#success-notice').fadeIn().delay(1000).slideUp(); |
| 32 | }); |
| 33 | }); |
| 34 | }); // end ready function |
| 35 | </script> |
| 36 | |
| 37 | |
| 38 | <div id="success-notice" class="wp-social-success-notice">Success! Your action was completed.</div> |
| 39 | <div class="wp-social-user-consent-for-banner notice notice-error"> |
| 40 | <p> |
| 41 | <input type="checkbox" <?php echo ( get_option( 'wp_social_user_consent_for_promotional_content', 'yes' ) == 'yes' ? esc_html( 'checked' ) : '' ); ?> value="yes" class="wp-social-admin-control-input" name="wp-social-user-consent-for-banner" id="wp-social-admin-switch__wp-social-user-consent-for-banner"> |
| 42 | <label for="wp-social-admin-switch__wp-social-user-consent-for-banner"><?php esc_html_e( 'Show update & fix related important messages, essential tutorials and promotional images on WP Dashboard', 'wp-social' ); ?></label> |
| 43 | </p> |
| 44 | </div> |
| 45 | |
| 46 |