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