Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: xmlrpc_default_posttype_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 2 times in this file.

Line Code
4540           } else {
4541                /**
4542                 * Filters the default query fields used by the given XML-RPC method.
4543                 *
4544                 * @since 3.4.0
4545                 *
4546                 * @param array  $fields An array of post type query fields for the given method.
4547                 * @param string $method The method name.
4548                 */
4549                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
4550           }
4551
4552           $user = $this->login( $username, $password );
4553           if ( ! $user ) {
4554                return $this->error;
4555           }
4556
4557           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4558           do_action( 'xmlrpc_call', 'wp.getPostType', $args, $this );
 
Line Code
4597
4598           $username = $args[1];
4599           $password = $args[2];
4600           $filter   = isset( $args[3] ) ? $args[3] : array( 'public' => true );
4601
4602           if ( isset( $args[4] ) ) {
4603                $fields = $args[4];
4604           } else {
4605                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4606                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
4607           }
4608
4609           $user = $this->login( $username, $password );
4610           if ( ! $user ) {
4611                return $this->error;
4612           }
4613
4614           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4615           do_action( 'xmlrpc_call', 'wp.getPostTypes', $args, $this );