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
4485           } else {
4486                /**
4487                 * Filters the default query fields used by the given XML-RPC method.
4488                 *
4489                 * @since 3.4.0
4490                 *
4491                 * @param array  $fields An array of post type query fields for the given method.
4492                 * @param string $method The method name.
4493                 */
4494                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
4495           }
4496
4497           $user = $this->login( $username, $password );
4498           if ( ! $user ) {
4499                return $this->error;
4500           }
4501
4502           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4503           do_action( 'xmlrpc_call', 'wp.getPostType', $args, $this );
 
Line Code
4542
4543           $username = $args[1];
4544           $password = $args[2];
4545           $filter   = isset( $args[3] ) ? $args[3] : array( 'public' => true );
4546
4547           if ( isset( $args[4] ) ) {
4548                $fields = $args[4];
4549           } else {
4550                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4551                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
4552           }
4553
4554           $user = $this->login( $username, $password );
4555           if ( ! $user ) {
4556                return $this->error;
4557           }
4558
4559           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4560           do_action( 'xmlrpc_call', 'wp.getPostTypes', $args, $this );