Skip to content

Instantly share code, notes, and snippets.

@uamv
Last active May 22, 2018 03:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uamv/b4f74afb91c0b9155f18e1766644d20d to your computer and use it in GitHub Desktop.
Save uamv/b4f74afb91c0b9155f18e1766644d20d to your computer and use it in GitHub Desktop.
Run once to automatically dismiss the Privacy Notice pointer in WP 4.9.6 for all users.
add_action( 'admin_init', 'typewheel_remove_privacy_notice_pointer_wp496' );
function typewheel_remove_privacy_notice_pointer_wp496() {
$users = get_users();
foreach ( $users as $user ) {
$dismissed = array_filter( explode( ',', (string) get_user_meta( $user->ID, 'dismissed_wp_pointers', true ) ) );
$pointer = 'wp496_privacy';
if ( ! in_array( $pointer, $dismissed ) ) {
$dismissed[] = $pointer;
$dismissed = implode( ',', $dismissed );
update_user_meta( $user->ID, 'dismissed_wp_pointers', $dismissed );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment