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