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
2223           } else {
2224                /**
2225                 * Filter the default user query fields used by the given XML-RPC method.
2226                 *
2227                 * @since 3.5.0
2228                 *
2229                 * @param array  $fields User query fields for given method. Default 'all'.
2230                 * @param string $method The method name.
2231                 */
2232                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getUser' );
2233           }
2234
2235           if ( ! $user = $this->login( $username, $password ) )
2236                return $this->error;
2237
2238           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2239           do_action( 'xmlrpc_call', 'wp.getUser' );
2240
2241           if ( ! current_user_can( 'edit_user', $user_id ) )
 
Line Code
2278
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
2347           $this->escape( $args );
2348
2349           $username   = $args[1];
2350           $password   = $args[2];
2351
2352           if ( isset( $args[3] ) ) {
2353                $fields = $args[3];
2354           } else {
2355                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2356                $fields = apply_filters( 'xmlrpc_default_user_fields', array( 'all' ), 'wp.getProfile' );
2357           }
2358
2359           if ( ! $user = $this->login( $username, $password ) )
2360                return $this->error;
2361
2362           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
2363           do_action( 'xmlrpc_call', 'wp.getProfile' );
2364
2365           if ( ! current_user_can( 'edit_user', $user->ID ) )