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