Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: xmlrpc_default_user_fields

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 3 times in this file.

Line Code
2338           } else {
2339                /**
2340                 * Filter the default user query fields used by the given XML-RPC method.
2341                 *
2342                 * @since 3.5.0
2343                 *
2344                 * @param array  $fields User query fields for given method. Default 'all'.
2345                 * @param string $method The method name.
2346                 */
2347                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );
2348           }
2349
2350           if ( ! $user = $this->login( $username, $password ) )
2351                return $this->error;
2352
2353           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2354           do_action( 'xmlrpc_call', 'wp.getUser' );
2355
2356           if ( ! current_user_can( 'edit_user', $user_id ) )
 
Line Code
2396
2397           $username = $args[1];
2398           $password = $args[2];
2399           $filter   = isset( $args[3] ) ? $args[3] : array();
2400
2401           if ( isset( $args[4] ) ) {
2402                $fields = $args[4];
2403           } else {
2404                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2405                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUsers' );
2406           }
2407
2408           if ( ! $user = $this->login( $username, $password ) )
2409                return $this->error;
2410
2411           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2412           do_action( 'xmlrpc_call', 'wp.getUsers' );
2413
2414           if ( ! current_user_can( 'list_users' ) )
 
Line Code
2469           $this->escape( $args );
2470
2471           $username = $args[1];
2472           $password = $args[2];
2473
2474           if ( isset( $args[3] ) ) {
2475                $fields = $args[3];
2476           } else {
2477                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2478                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
2479           }
2480
2481           if ( ! $user = $this->login( $username, $password ) )
2482                return $this->error;
2483
2484           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2485           do_action( 'xmlrpc_call', 'wp.getProfile' );
2486
2487           if ( ! current_user_can( 'edit_user', $user->ID ) )