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