Open
Conversation
fclaussen
requested changes
Jul 7, 2020
| update_option( 'gdpr_consent_types', '' ); | ||
| update_option( 'gdpr_privacy_bar_position', 'bottom' ); | ||
|
|
||
| GDPR_Audit_Log::log( $user->ID, sprintf( esc_html__( 'Plugin data reset on %1$s.', 'gdpr' ), date( 'm/d/Y' ) ) ); |
Member
There was a problem hiding this comment.
Let's rephrase this to "Plugin Settings were reset on %1$s"
| <?php | ||
| echo sprintf( | ||
| /* translators: External link with instructions on how to proceed. */ | ||
| esc_html__( 'To reset plugin data please click %s.', 'gdpr' ), |
Member
There was a problem hiding this comment.
"To reset these settings, please click %s"
| * @since 1.0.0 | ||
| * @author Moutushi Mandal <moutushi82@gmail.com> | ||
| */ | ||
| public function reset_plugin_data() { |
Member
There was a problem hiding this comment.
please rename to reset_plugin_settings
| add_action( 'admin_post_gdpr_mark_resolved', array( $requests_admin, 'mark_resolved' ) ); | ||
| add_action( 'wp_ajax_gdpr_anonymize_comments', array( $requests_admin, 'anonymize_comments' ) ); | ||
| add_action( 'wp_ajax_gdpr_reassign_content', array( $requests_admin, 'reassign_content' ) ); | ||
| add_action( 'wp_ajax_gdpr_reset_plugin_data', array( $requests_admin, 'reset_plugin_data' ) ); |
Member
There was a problem hiding this comment.
and it should also bee wp_ajax_gdpr_reset_plugin_settings
| ); | ||
| } ); | ||
|
|
||
| $( document ).on( 'click', '.gdpr-reset-data', function( e ) { |
| $.post( | ||
| ajaxurl, | ||
| { | ||
| action: 'gdpr_reset_plugin_data', |
| nonce: nonce | ||
| }, | ||
| function( res ) { | ||
| alert( 'All data deleted successfully!' ); |
Member
There was a problem hiding this comment.
All settings deleted successfully!
This also needs to be translatable.
| } | ||
| } | ||
|
|
||
| .gdpr-reset-data { |
| * @author Moutushi Mandal <moutushi82@gmail.com> | ||
| */ | ||
| public function reset_plugin_data() { | ||
| if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( sanitize_key( wp_unslash( $_POST['nonce'] ) ), 'gdpr_reset_data' ) ) { // phpcs:ignore |
| echo sprintf( | ||
| /* translators: External link with instructions on how to proceed. */ | ||
| esc_html__( 'To reset plugin data please click %s.', 'gdpr' ), | ||
| '<a href="#" class="gdpr-reset-data" data-nonce="' . esc_attr( wp_create_nonce( 'gdpr_reset_data' ) ) .'">' . esc_html__( 'here', 'gdpr' ) . '</a>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.