xmlrpc_prepare_user

Filters XML-RPC-prepared data for the given user.

Description

apply_filters( 'xmlrpc_prepare_user', (WP_User) $user, (WP_User) $user, (array) $fields ); 

Parameters (3)

0. $user (array)
An array of user data.
1. $user (WP_User)
User object.
2. $fields (array)
An array of user fields.

Usage

To run the hook, copy the example below.
  1. $user = apply_filters( 'xmlrpc_prepare_user', $user, $user, $fields ); 
  2.  
  3. if ( !empty( $user ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the xmlrpc_prepare_user callback 
  2. function filter_xmlrpc_prepare_user( $user, $user, $fields ) { 
  3. // make filter magic happen here... 
  4. return $user
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'xmlrpc_prepare_user', 'filter_xmlrpc_prepare_user', 10, 3 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'xmlrpc_prepare_user', 'filter_xmlrpc_prepare_user', 10, 3 ); 

Defined (1)

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

/wp-includes/class-wp-xmlrpc-server.php  
  1. return apply_filters( 'xmlrpc_prepare_user', $_user, $user, $fields );