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
4096           } else {
4097                /**
4098                 * Filters the default query fields used by the given XML-RPC method.
4099                 *
4100                 * @since 3.4.0
4101                 *
4102                 * @param array  $fields An array of post type query fields for the given method.
4103                 * @param string $method The method name.
4104                 */
4105                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
4106           }
4107
4108           if ( !$user = $this->login( $username, $password ) )
4109                return $this->error;
4110
4111           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4112           do_action( 'xmlrpc_call', 'wp.getPostType' );
4113
4114           if ( ! post_type_exists( $post_type_name ) )
 
Line Code
4148
4149           $username = $args[1];
4150           $password = $args[2];
4151           $filter   = isset( $args[3] ) ? $args[3] : array( 'public' => true );
4152
4153           if ( isset( $args[4] ) ) {
4154                $fields = $args[4];
4155           } else {
4156                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4157                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
4158           }
4159
4160           if ( ! $user = $this->login( $username, $password ) )
4161                return $this->error;
4162
4163           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4164           do_action( 'xmlrpc_call', 'wp.getPostTypes' );
4165
4166           $post_types = get_post_types( $filter, 'objects' );