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
2399           } else {
2400                /**
2401                 * Filters the default user query fields used by the given XML-RPC method.
2402                 *
2403                 * @since 3.5.0
2404                 *
2405                 * @param array  $fields User query fields for given method. Default 'all'.
2406                 * @param string $method The method name.
2407                 */
2408                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );
2409           }
2410
2411           if ( ! $user = $this->login( $username, $password ) )
2412                return $this->error;
2413
2414           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2415           do_action( 'xmlrpc_call', 'wp.getUser' );
2416
2417           if ( ! current_user_can( 'edit_user', $user_id ) )
 
Line Code
2457
2458           $username = $args[1];
2459           $password = $args[2];
2460           $filter   = isset( $args[3] ) ? $args[3] : array();
2461
2462           if ( isset( $args[4] ) ) {
2463                $fields = $args[4];
2464           } else {
2465                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2466                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUsers' );
2467           }
2468
2469           if ( ! $user = $this->login( $username, $password ) )
2470                return $this->error;
2471
2472           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2473           do_action( 'xmlrpc_call', 'wp.getUsers' );
2474
2475           if ( ! current_user_can( 'list_users' ) )
 
Line Code
2530           $this->escape( $args );
2531
2532           $username = $args[1];
2533           $password = $args[2];
2534
2535           if ( isset( $args[3] ) ) {
2536                $fields = $args[3];
2537           } else {
2538                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2539                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
2540           }
2541
2542           if ( ! $user = $this->login( $username, $password ) )
2543                return $this->error;
2544
2545           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2546           do_action( 'xmlrpc_call', 'wp.getProfile' );
2547
2548           if ( ! current_user_can( 'edit_user', $user->ID ) )