Created
October 29, 2016 14:25
-
-
Save X-Raym/6e4ae92db8666608e78315a48740a549 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