# This patch file was generated by NetBeans IDE
# Following Index: paths are relative to: /var/www/GSoC/wordtrunk/wp-includes
# This patch can be applied using context Tools: Patch action on respective folder.
# It uses platform neutral UTF-8 encoding and \n newlines.
# Above lines and this line are ignored by the patching process.
Index: class-wp-xmlrpc-server.php
--- class-wp-xmlrpc-server.php Base (BASE)
+++ class-wp-xmlrpc-server.php Locally Modified (Based On LOCAL)
@@ -64,6 +64,7 @@
 			'wp.getMediaItem'		=> 'this:wp_getMediaItem',
 			'wp.getMediaLibrary'	=> 'this:wp_getMediaLibrary',
 			'wp.getPostFormats'     => 'this:wp_getPostFormats',
+                        'wp.getPostType'        => 'this:wp_getPostType',
 
 			// Blogger API
 			'blogger.getUsersBlogs' => 'this:blogger_getUsersBlogs',
@@ -1702,6 +1703,65 @@
 		return $formats;
 	}
 
+        /**
+         * Retrieves a post type
+         *
+         * @uses get_post_type_object()
+         * @param array $args Method parameters. Contains:
+         *  - int     $blog_id
+         *  - string  $username
+         *  - string  $password
+         *  - string  $post_type_name
+         * @return array contains:
+         *  - 'labels'
+         *  - 'description'
+         *  - 'capability_type'
+         *  - 'cap'
+         *  - 'map_meta_cap'
+         *  - 'hierarchical'
+         *  - 'menu_position'
+         *  - 'taxonomies'
+         */
+        function wp_getPostType( $args ) {
+
+		$this->escape( $args );
+
+                $blog_ID        = (int) $args[0];
+                $username       = $args[1];
+                $password       = $args[2];
+                $post_type_name = $args[3];
+
+		if ( ! $user = $this->login( $username, $password ) )
+			return $this->error;
+
+                $post_type_names = get_post_types('', 'names');
+
+                if( ! in_array( $post_type_name, $post_type_names ) )
+                        return new IXR_Error( 403, __( 'The post type specified is not valid' ) );
+
+                $post_type = get_post_type_object( $post_type_name );
+
+                //capability check
+                if( ! current_user_can( $post_type->cap->edit_posts ) )
+                        return new IXR_Error( 401, __( 'Sorry, you are not allowed to edit this post type' ) );
+
+                $post_type = (array)$post_type;
+
+                $post_type_data = array(
+                                'labels'            => $post_type['labels'],
+                                'description'       => $post_type['description'],
+                                'capability_type'   => $post_type['capability_type'],
+                                'cap'               => $post_type['cap'],
+                                'map_meta_cap'      => $post_type['map_meta_cap'],
+                                'hierarchical'      => $post_type['hierarchical'],
+                                'menu_position'     => $post_type['menu_position'],
+                                'taxonomies'        => get_object_taxonomies( $post_type['name'] ),
+                        );
+
+                return $post_type_data;
+        
+        }
+
 	/* Blogger API functions.
 	 * specs on http://plant.blogger.com/api and http://groups.yahoo.com/group/bloggerDev/
 	 */
