Skip to content

Instantly share code, notes, and snippets.

@coreymckrill
Last active July 5, 2018 16:07
Show Gist options
  • Save coreymckrill/bed546ef05c9917d0d01618588a2c206 to your computer and use it in GitHub Desktop.
Save coreymckrill/bed546ef05c9917d0d01618588a2c206 to your computer and use it in GitHub Desktop.
<?php
// Drop this file into wp-content/mu-plugins.
// Test 1 - Remove Feedback callbacks from data export/erasure tools.
// Uncomment the next two lines to test.
//add_filter( 'wp_privacy_personal_data_exporters', 'remove_feedback_callback', 20 );
//add_filter( 'wp_privacy_personal_data_erasers', 'remove_feedback_callback', 20 );
function remove_feedback_callback( $callbacks ) {
unset( $callbacks['jetpack-feedback'] );
return $callbacks;
}
// Test 2 - Prevent erasure of a feedback post.
// Uncomment the next line to test.
//add_filter( 'grunion_contact_form_delete_feedback_post', 'prevent_feedback_post_erasure', 10, 2 );
function prevent_feedback_post_erasure( $prevention_message, $post_id ) {
$prevention_message = sprintf(
'Feedback with ID %d could not be erased because reasons.',
$post_id
);
return $prevention_message;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment