WordPress at Your Fingertips
function is not described

wc_update_340_last_active() WC 1.0

Set last active prop for users.

No Hooks.


null. Nothing.



Code of wc_update_340_last_active() WC 5.5.2

function wc_update_340_last_active() {
	global $wpdb;
	// @codingStandardsIgnoreStart.
		$wpdb->prepare( "
			INSERT INTO {$wpdb->usermeta} (user_id, meta_key, meta_value)
			SELECT DISTINCT users.ID, 'wc_last_active', %s
			FROM {$wpdb->users} as users
			LEFT OUTER JOIN {$wpdb->usermeta} AS usermeta ON users.ID = usermeta.user_id AND usermeta.meta_key = 'wc_last_active'
			WHERE usermeta.meta_value IS NULL
			(string) strtotime( date( 'Y-m-d', current_time( 'timestamp', true ) ) )
	// @codingStandardsIgnoreEnd.