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
3978           } else {
3979                /**
3980                 * Filter the default query fields used by the given XML-RPC method.
3981                 *
3982                 * @since 3.4.0
3983                 *
3984                 * @param array  $fields An array of post type query fields for the given method.
3985                 * @param string $method The method name.
3986                 */
3987                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
3988           }
3989
3990           if ( !$user = $this->login( $username, $password ) )
3991                return $this->error;
3992
3993           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
3994           do_action( 'xmlrpc_call', 'wp.getPostType' );
3995
3996           if ( ! post_type_exists( $post_type_name ) )
 
Line Code
4030
4031           $username = $args[1];
4032           $password = $args[2];
4033           $filter   = isset( $args[3] ) ? $args[3] : array( 'public' => true );
4034
4035           if ( isset( $args[4] ) ) {
4036                $fields = $args[4];
4037           } else {
4038                /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4039                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
4040           }
4041
4042           if ( ! $user = $this->login( $username, $password ) )
4043                return $this->error;
4044
4045           /** This action is documented in wp-includes/class-wp-xmlrpc-server.php */
4046           do_action( 'xmlrpc_call', 'wp.getPostTypes' );
4047
4048           $post_types = get_post_types( $filter, 'objects' );