A WordPress-centric search engine for devs and theme authors



wpmu_log_new_registrations ›

Since3.0.0
Deprecatedn/a
wpmu_log_new_registrations ( $blog_id, $user_id )
Parameters: (2)
  • (int) $blog_id
    Required: Yes
  • (int) $user_id
    Required: Yes
Defined at:
Codex:
Change Log:
  • MU

Logs the user email, IP, and registration date of a new site.



Source

function wpmu_log_new_registrations( $blog_id, $user_id ) {
	global $wpdb;
	$user = get_userdata( (int) $user_id );
	if ( $user ) {
		$wpdb->insert(
			$wpdb->registration_log, array(
				'email'           => $user->user_email,
				'IP'              => preg_replace( '/[^0-9., ]/', '', wp_unslash( $_SERVER['REMOTE_ADDR'] ) ),
				'blog_id'         => $blog_id,
				'date_registered' => current_time( 'mysql' ),
			)
		);
	}
}