mirror of
https://github.com/10h30/ultimatemember.git
synced 2026-07-11 18:56:10 +09:00
8e348e084e
- some code optimization and documentation; - fixed conflict with WP Fusion;
19 lines
527 B
PHP
19 lines
527 B
PHP
<?php
|
|
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
|
|
|
|
|
/**
|
|
* This populates all existing UM users with meta_key `last_login` as `user_registered` if the meta key doesn't exist.
|
|
* Target Version: 1.3.39
|
|
*/
|
|
global $wpdb;
|
|
$wpdb->query(
|
|
'INSERT INTO '.$wpdb->usermeta.'(user_id, meta_key, meta_value)
|
|
SELECT uu.ID, "_um_last_login", uu.user_registered
|
|
FROM '.$wpdb->users.' AS uu
|
|
WHERE uu.ID NOT IN(
|
|
SELECT user_id FROM '.$wpdb->usermeta.'
|
|
WHERE meta_key = "_um_last_login"
|
|
GROUP BY user_id
|
|
)'
|
|
); |