Forked from X-Raym/Delete learndash user infos after a certain date.php
Created
July 31, 2021 22:38
-
-
Save onwp/41f4b5630b271e61e7c69b78df6a7b88 to your computer and use it in GitHub Desktop.
Delete learndash user infos after a certain date
This file contains 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
<?php | |
define( 'WP_USE_THEMES', false ); | |
require( 'wp-blog-header.php' ); | |
$usermeta = get_user_meta( 354, '_sfwd-quizzes', true ); | |
$new = array(); | |
foreach ($usermeta as $key => $value) { | |
if ( $value['time'] < 1476545002 ) | |
array_push($new, $value); | |
} | |
update_user_meta( 354, '_sfwd-quizzes', $new); | |
d($new); | |
ddd( $usermeta ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment