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
3415
3416           $blog_id        = (int) $args[0];
3417           $username       = $args[1];
3418           $password       = $args[2];
3419           $post_type_name = $args[3];
3420
3421           if ( isset( $args[4] ) )
3422                $fields = $args[4];
3423           else
3424                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostType' );
3425
3426           if ( !$user = $this->login( $username, $password ) )
3427                return $this->error;
3428
3429           do_action( 'xmlrpc_call', 'wp.getPostType' );
3430
3431           if( ! post_type_exists( $post_type_name ) )
3432                return new IXR_Error( 403, __( 'Invalid post type' ) );
3433
 
Line Code
3461
3462           $blog_id            = (int) $args[0];
3463           $username           = $args[1];
3464           $password           = $args[2];
3465           $filter             = isset( $args[3] ) ? $args[3] : array( 'public' => true );
3466
3467           if ( isset( $args[4] ) )
3468                $fields = $args[4];
3469           else
3470                $fields = apply_filters( 'xmlrpc_default_posttype_fields', array( 'labels', 'cap', 'taxonomies' ), 'wp.getPostTypes' );
3471
3472           if ( ! $user = $this->login( $username, $password ) )
3473                return $this->error;
3474
3475           do_action( 'xmlrpc_call', 'wp.getPostTypes' );
3476
3477           $post_types = get_post_types( $filter, 'objects' );
3478
3479           $struct = array();