wpmu_log_new_registrations

Logs user registrations.

Description

wpmu_log_new_registrations( (int) $blog_id, (int) $user_id ); 

Parameters (2)

0. $blog_id (int)
The blog id.
1. $user_id (int)
The user id.

Usage

  1. if ( !function_exists( 'wpmu_log_new_registrations' ) ) { 
  2. require_once ABSPATH . WPINC . '/ms-functions.php'; 
  3.  
  4. // The blog id. 
  5. $blog_id = -1; 
  6.  
  7. // The user id. 
  8. $user_id = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = wpmu_log_new_registrations($blog_id, $user_id); 
  12.  

Defined (1)

The function is defined in the following location(s).

/wp-includes/ms-functions.php  
  1. function wpmu_log_new_registrations( $blog_id, $user_id ) { 
  2. global $wpdb; 
  3. $user = get_userdata( (int) $user_id ); 
  4. if ( $user ) 
  5. $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')) );