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
3422
3423           $blog_id        = (int) $args[0];
3424           $username       = $args[1];
3425           $password       = $args[2];
3426           $post_type_name = $args[3];
3427
3428           if ( isset( $args[4] ) )
3429                $fields = $args[4];
3430           else
3431                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
3432
3433           if ( !$user = $this->login( $username, $password ) )
3434                return $this->error;
3435
3436           do_action( 'xmlrpc_call', 'wp.getPostType' );
3437
3438           if( ! post_type_exists( $post_type_name ) )
3439                return new IXR_Error( 403, __( 'Invalid post type' ) );
3440
 
Line Code
3468
3469           $blog_id            = (int) $args[0];
3470           $username           = $args[1];
3471           $password           = $args[2];
3472           $filter             = isset( $args[3] ) ? $args[3] : array( 'public' => true );
3473
3474           if ( isset( $args[4] ) )
3475                $fields = $args[4];
3476           else
3477                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
3478
3479           if ( ! $user = $this->login( $username, $password ) )
3480                return $this->error;
3481
3482           do_action( 'xmlrpc_call', 'wp.getPostTypes' );
3483
3484           $post_types = get_post_types( $filter, 'objects' );
3485
3486           $struct = array();