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
2222           } else {
2223                /**
2224                 * Filter the default user query fields used by the given XML-RPC method.
2225                 *
2226                 * @since 3.5.0
2227                 *
2228                 * @param array  $fields User query fields for given method. Default 'all'.
2229                 * @param string $method The method name.
2230                 */
2231                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );
2232           }
2233
2234           if ( ! $user = $this->login( $username, $password ) )
2235                return $this->error;
2236
2237           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2238           do_action( 'xmlrpc_call', 'wp.getUser' );
2239
2240           if ( ! current_user_can( 'edit_user', $user_id ) )
 
Line Code
2278           $blog_id    = (int) $args[0];
2279           $username   = $args[1];
2280           $password   = $args[2];
2281           $filter     = isset( $args[3] ) ? $args[3] : array();
2282
2283           if ( isset( $args[4] ) ) {
2284                $fields = $args[4];
2285           } else {
2286                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2287                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUsers' );
2288           }
2289
2290           if ( ! $user = $this->login( $username, $password ) )
2291                return $this->error;
2292
2293           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2294           do_action( 'xmlrpc_call', 'wp.getUsers' );
2295
2296           if ( ! current_user_can( 'list_users' ) )
 
Line Code
2348
2349           $blog_id    = (int) $args[0];
2350           $username   = $args[1];
2351           $password   = $args[2];
2352
2353           if ( isset( $args[3] ) ) {
2354                $fields = $args[3];
2355           } else {
2356                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2357                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
2358           }
2359
2360           if ( ! $user = $this->login( $username, $password ) )
2361                return $this->error;
2362
2363           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2364           do_action( 'xmlrpc_call', 'wp.getProfile' );
2365
2366           if ( ! current_user_can( 'edit_user', $user->ID ) )