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
2024
2025           $blog_id    = (int) $args[0];
2026           $username   = $args[1];
2027           $password   = $args[2];
2028           $user_id    = (int) $args[3];
2029
2030           if ( isset( $args[4] ) )
2031                $fields = $args[4];
2032           else
2033                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );
2034
2035           if ( ! $user = $this->login( $username, $password ) )
2036                return $this->error;
2037
2038           do_action( 'xmlrpc_call', 'wp.getUser' );
2039
2040           if ( ! current_user_can( 'edit_user', $user_id ) )
2041                return new IXR_Error( 401, __( 'Sorry, you cannot edit users.' ) );
2042
 
Line Code
2077
2078           $blog_id    = (int) $args[0];
2079           $username   = $args[1];
2080           $password   = $args[2];
2081           $filter     = isset( $args[3] ) ? $args[3] : array();
2082
2083           if ( isset( $args[4] ) )
2084                $fields = $args[4];
2085           else
2086                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUsers' );
2087
2088           if ( ! $user = $this->login( $username, $password ) )
2089                return $this->error;
2090
2091           do_action( 'xmlrpc_call', 'wp.getUsers' );
2092
2093           if ( ! current_user_can( 'list_users' ) )
2094                return new IXR_Error( 401, __( 'Sorry, you cannot list users.' ) );
2095
 
Line Code
2144           $this->escape( $args );
2145
2146           $blog_id    = (int) $args[0];
2147           $username   = $args[1];
2148           $password   = $args[2];
2149
2150           if ( isset( $args[3] ) )
2151                $fields = $args[3];
2152           else
2153                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
2154
2155           if ( ! $user = $this->login( $username, $password ) )
2156                return $this->error;
2157
2158           do_action( 'xmlrpc_call', 'wp.getProfile' );
2159
2160           if ( ! current_user_can( 'edit_user', $user->ID ) )
2161                return new IXR_Error( 401, __( 'Sorry, you cannot edit your profile.' ) );
2162