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