diff --git src/wp-admin/includes/nav-menu.php src/wp-admin/includes/nav-menu.php
index d8947d8..1a2f30b 100644
--- src/wp-admin/includes/nav-menu.php
+++ src/wp-admin/includes/nav-menu.php
@@ -293,7 +293,7 @@ function wp_nav_menu_item_link_meta_box() {
  * @global int|string $nav_menu_selected_id
  *
  * @param string $object Not used.
- * @param string $post_type The post type object.
+ * @param object $post_type The post type object.
  */
 function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) {
 	global $_nav_menu_placeholder, $nav_menu_selected_id;
diff --git src/wp-includes/class-wp-post-type.php src/wp-includes/class-wp-post-type.php
new file mode 100644
index 0000000..3f33e68
--- /dev/null
+++ src/wp-includes/class-wp-post-type.php
@@ -0,0 +1,556 @@
+<?php
+/**
+ * Post API: WP_Post_Type class
+ *
+ * @package WordPress
+ * @subpackage Post
+ * @since 4.6.0
+ */
+
+/**
+ * Core class used for interacting with post types.
+ *
+ * @since 4.6.0
+ */
+final class WP_Post_Type {
+	/**
+	 * Post type key.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var string
+	 */
+	public $name;
+
+	/**
+	 * Name of the post type shown in the menu. Usually plural.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var string
+	 */
+	public $label;
+
+	/**
+	 * An array of labels for this post type.
+	 *
+	 * If not set, post labels are inherited for non-hierarchical types
+	 * and page labels for hierarchical ones.
+	 *
+	 * @see get_post_type_labels()
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var array
+	 */
+	public $labels;
+
+	/**
+	 * A short descriptive summary of what the post type is.
+	 *
+	 * Default empty.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var string
+	 */
+	public $description = '';
+
+	/**
+	 * Whether a post type is intended for use publicly either via the admin interface or by front-end users.
+	 *
+	 * While the default settings of $exclude_from_search, $publicly_queryable, $show_ui, and $show_in_nav_menus
+	 * are inherited from public, each does not rely on this relationship and controls a very specific intention.
+	 *
+	 * Default false.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $public = false;
+
+	/**
+	 * Whether the post type is hierarchical (e.g. page).
+	 *
+	 * Default false.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $hierarchical = false;
+
+	/**
+	 * Whether to exclude posts with this post type from front end search
+	 * results.
+	 *
+	 * Default is the opposite value of $public.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $exclude_from_search = null;
+
+	/**
+	 * Whether queries can be performed on the front end for the post type as part of {@see parse_request()}.
+	 *
+	 * Endpoints would include:
+	 * ?post_type={post_type_key}
+	 * ?{post_type_key}={single_post_slug}
+	 * ?{post_type_query_var}={single_post_slug}
+	 *
+	 * Default is the value of $public.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $publicly_queryable = null;
+
+	/**
+	 * Whether to generate and allow a UI for managing this post type in the admin.
+	 *
+	 * Default is the value of $public.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $show_ui = null;
+
+	/**
+	 * Where to show the post type in the admin menu.
+	 *
+	 * To work, $show_ui must be true. If true, the post type is shown in its own top level menu. If false, no menu is shown.
+	 * If a string of an existing top level menu (eg. 'tools.php' or 'edit.php?post_type=page'), the post
+	 * type will be placed as a sub-menu of that.
+	 *
+	 * Default is the value of $show_ui.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $show_in_menu = null;
+
+	/**
+	 * Makes this post type available for selection in navigation menus.
+	 *
+	 * Default is the value $public.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $show_in_nav_menus = null;
+
+	/**
+	 * Makes this post type available via the admin bar.
+	 *
+	 * Default is the value of $show_in_menu.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $show_in_admin_bar = null;
+
+	/**
+	 * The position in the menu order the post type should appear.
+	 *
+	 * To work, $show_in_menu must be true. Default null (at the bottom).
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var int
+	 */
+	public $menu_position = null;
+
+	/**
+	 * The url to the icon to be used for this menu.
+	 *
+	 * Pass a base64-encoded SVG using a data URI, which will be colored to match the color scheme.
+	 * This should begin with 'data:image/svg+xml;base64,'. Pass the name of a Dashicons helper class to use a font icon, e.g.
+	 * 'dashicons-chart-pie'. Pass 'none' to leave div.wp-menu-image empty so an icon can be added via CSS.
+	 *
+	 * Defaults to use the posts icon.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var string
+	 */
+	public $menu_icon = null;
+
+	/**
+	 * The string to use to build the read, edit, and delete capabilities.
+	 *
+	 * May be passed as an array to allow for alternative plurals when using
+	 * this argument as a base to construct the capabilities, e.g.
+	 * array('story', 'stories'). Default 'post'.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var string
+	 */
+	public $capability_type = 'post';
+
+	/**
+	 * Whether to use the internal default meta capability handling.
+	 *
+	 * Default false.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $map_meta_cap = false;
+
+	/**
+	 * Provide a callback function that sets up the meta boxes for the edit form.
+	 *
+	 * Do remove_meta_box() and add_meta_box() calls in the callback. Default null.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var string
+	 */
+	public $register_meta_box_cb = null;
+
+	/**
+	 * An array of taxonomy identifiers that will be registered for the post type.
+	 *
+	 * Taxonomies can be registered later with {@see register_taxonomy()} or {@see register_taxonomy_for_object_type()}.
+	 *
+	 * Default empty array.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var array
+	 */
+	public $taxonomies = array();
+
+	/**
+	 * Whether there should be post type archives, or if a string, the archive slug to use.
+	 *
+	 * Will generate the proper rewrite rules if $rewrite is enabled. Default false.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool|string
+	 */
+	public $has_archive = false;
+
+	/**
+	 * Sets the query_var key for this post type.
+	 *
+	 * Defaults to $post_type key. If false, a post type cannot be loaded at ?{query_var}={post_slug}.
+	 * If specified as a string, the query ?{query_var_string}={post_slug} will be valid.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var string|bool
+	 */
+	public $query_var;
+
+	/**
+	 * Whether to allow this post type to be exported.
+	 *
+	 * Default true.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $can_export = true;
+
+	/**
+	 * Whether to delete posts of this type when deleting a user.
+	 *
+	 * If true, posts of this type belonging to the user will be moved to trash when then user is deleted.
+	 * If false, posts of this type belonging to the user will *not* be trashed or deleted.
+	 * If not set (the default),  posts are trashed if post_type_supports('author').
+	 * Otherwise posts are not trashed or deleted. Default null.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $delete_with_user = null;
+
+	/**
+	 * Whether this post type is a native or "built-in" post_type.
+	 *
+	 * Default false.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var bool
+	 */
+	public $_builtin = false;
+
+	/**
+	 * URL segment to use for edit link of this post type.
+	 *
+	 * Default 'post.php?post=%d'
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var string
+	 */
+	public $_edit_link = 'post.php?post=%d';
+
+
+	/**
+	 * Post type capabilities.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var array
+	 */
+	public $cap;
+
+	/**
+	 * Triggers the handling of rewrites for this post type.
+	 *
+	 * Defaults to true, using $post_type as slug
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 * @var array|false
+	 */
+	public $rewrite;
+
+	/**
+	 * Creates a new WP_Post_Type object.
+	 *
+	 * Will populate object properties from the  provided arguments and assign other
+	 * default properties based on that information.
+	 *
+	 * @since 4.6.0
+	 * @access public
+	 *
+	 * @global WP_Rewrite $wp_rewrite Used for default feeds.
+	 * @global WP         $wp         Used to add query vars.
+	 *
+	 * @see register_post_type()
+	 *
+	 * @param string $post_type Post type key.
+	 * @param array|string $args Array or string of arguments for registering a post type.
+	 */
+	public function __construct( $post_type, $args = array() ) {
+		global $wp, $wp_rewrite;
+
+		$args = wp_parse_args( $args );
+
+		/**
+		 * Filter the arguments for registering a post type.
+		 *
+		 * @since 4.4.0
+		 *
+		 * @param array  $args      Array of arguments for registering a post type.
+		 * @param string $post_type Post type key.
+		 */
+		$args = apply_filters( 'register_post_type_args', $args, $post_type );
+
+		$has_edit_link = ! empty( $args['_edit_link'] );
+
+		// Args prefixed with an underscore are reserved for internal use.
+		$defaults = array(
+			'labels'               => array(),
+			'description'          => '',
+			'public'               => false,
+			'hierarchical'         => false,
+			'exclude_from_search'  => null,
+			'publicly_queryable'   => null,
+			'show_ui'              => null,
+			'show_in_menu'         => null,
+			'show_in_nav_menus'    => null,
+			'show_in_admin_bar'    => null,
+			'menu_position'        => null,
+			'menu_icon'            => null,
+			'capability_type'      => 'post',
+			'capabilities'         => array(),
+			'map_meta_cap'         => null,
+			'supports'             => array(),
+			'register_meta_box_cb' => null,
+			'taxonomies'           => array(),
+			'has_archive'          => false,
+			'rewrite'              => true,
+			'query_var'            => true,
+			'can_export'           => true,
+			'delete_with_user'     => null,
+			'_builtin'             => false,
+			'_edit_link'           => 'post.php?post=%d',
+		);
+		$args = array_merge( $defaults, $args );
+		$args = (object) $args;
+
+		$args->name = $post_type;
+
+		// If not set, default to the setting for public.
+		if ( null === $args->publicly_queryable ) {
+			$args->publicly_queryable = $args->public;
+		}
+
+		// If not set, default to the setting for public.
+		if ( null === $args->show_ui ) {
+			$args->show_ui = $args->public;
+		}
+
+		// If not set, default to the setting for show_ui.
+		if ( null === $args->show_in_menu || ! $args->show_ui ) {
+			$args->show_in_menu = $args->show_ui;
+		}
+
+		// If not set, default to the whether the full UI is shown.
+		if ( null === $args->show_in_admin_bar ) {
+			$args->show_in_admin_bar = (bool) $args->show_in_menu;
+		}
+
+		// If not set, default to the setting for public.
+		if ( null === $args->show_in_nav_menus ) {
+			$args->show_in_nav_menus = $args->public;
+		}
+
+		// If not set, default to true if not public, false if public.
+		if ( null === $args->exclude_from_search ) {
+			$args->exclude_from_search = ! $args->public;
+		}
+
+		// Back compat with quirky handling in version 3.0. #14122.
+		if ( empty( $args->capabilities ) && null === $args->map_meta_cap && in_array( $args->capability_type, array(
+				'post',
+				'page',
+			) )
+		) {
+			$args->map_meta_cap = true;
+		}
+
+		// If not set, default to false.
+		if ( null === $args->map_meta_cap ) {
+			$args->map_meta_cap = false;
+		}
+
+		// If there's no specified edit link and no UI, remove the edit link.
+		if ( ! $args->show_ui && ! $has_edit_link ) {
+			$args->_edit_link = '';
+		}
+
+		$this->cap = get_post_type_capabilities( $args );
+		unset( $args->capabilities );
+
+		if ( is_array( $args->capability_type ) ) {
+			$args->capability_type = $args->capability_type[0];
+		}
+
+		if ( ! empty( $args->supports ) ) {
+			add_post_type_support( $post_type, $args->supports );
+			unset( $args->supports );
+		} elseif ( false !== $args->supports ) {
+			// Add default features
+			add_post_type_support( $post_type, array( 'title', 'editor' ) );
+		}
+
+		if ( false !== $args->query_var ) {
+			if ( true === $args->query_var ) {
+				$args->query_var = $post_type;
+			} else {
+				$args->query_var = sanitize_title_with_dashes( $args->query_var );
+			}
+
+			if ( $wp && is_post_type_viewable( $args ) ) {
+				$wp->add_query_var( $args->query_var );
+			}
+		}
+
+		if ( false !== $args->rewrite && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
+			if ( ! is_array( $args->rewrite ) ) {
+				$args->rewrite = array();
+			}
+			if ( empty( $args->rewrite['slug'] ) ) {
+				$args->rewrite['slug'] = $post_type;
+			}
+			if ( ! isset( $args->rewrite['with_front'] ) ) {
+				$args->rewrite['with_front'] = true;
+			}
+			if ( ! isset( $args->rewrite['pages'] ) ) {
+				$args->rewrite['pages'] = true;
+			}
+			if ( ! isset( $args->rewrite['feeds'] ) || ! $args->has_archive ) {
+				$args->rewrite['feeds'] = (bool) $args->has_archive;
+			}
+			if ( ! isset( $args->rewrite['ep_mask'] ) ) {
+				if ( isset( $args->permalink_epmask ) ) {
+					$args->rewrite['ep_mask'] = $args->permalink_epmask;
+				} else {
+					$args->rewrite['ep_mask'] = EP_PERMALINK;
+				}
+			}
+
+			if ( $args->hierarchical ) {
+				add_rewrite_tag( "%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&pagename=" );
+			} else {
+				add_rewrite_tag( "%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=" );
+			}
+
+			if ( $args->has_archive ) {
+				$archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;
+				if ( $args->rewrite['with_front'] ) {
+					$archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;
+				} else {
+					$archive_slug = $wp_rewrite->root . $archive_slug;
+				}
+
+				add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
+				if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {
+					$feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';
+					add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
+					add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
+				}
+				if ( $args->rewrite['pages'] ) {
+					add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );
+				}
+			}
+
+			$permastruct_args         = $args->rewrite;
+			$permastruct_args['feed'] = $permastruct_args['feeds'];
+			add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $permastruct_args );
+		}
+
+		// Register the post type meta box if a custom callback was specified.
+		if ( $args->register_meta_box_cb ) {
+			add_action( 'add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1 );
+		}
+
+		foreach( get_object_vars( $args) as $property_name => $property_value ) {
+			$this->$property_name = $property_value;
+		}
+
+		$this->labels = get_post_type_labels( $this );
+		$this->label  = $this->labels->name;
+	}
+
+	/**
+	 * Retrieves a post type object by name.
+	 *
+	 * @since  4.6.0
+	 * @access public
+	 * @static
+	 *
+	 * @global array $wp_post_types List of post types.
+	 *
+	 * @param string $post_type     The name of a registered post type.
+	 * @return WP_Post_Type|null WP_Post_Type object if it exists, null otherwise.
+	 */
+	public static function get_instance( $post_type ) {
+		global $wp_post_types;
+
+		if ( ! is_scalar( $post_type ) || empty( $wp_post_types[ $post_type ] ) ) {
+			return null;
+		}
+
+		return $wp_post_types[ $post_type ];
+	}
+}
diff --git src/wp-includes/class-wp-xmlrpc-server.php src/wp-includes/class-wp-xmlrpc-server.php
index c331591..81716a0 100644
--- src/wp-includes/class-wp-xmlrpc-server.php
+++ src/wp-includes/class-wp-xmlrpc-server.php
@@ -870,8 +870,8 @@ class wp_xmlrpc_server extends IXR_Server {
 	 *
 	 * @access protected
 	 *
-	 * @param object $post_type Post type object.
-	 * @param array  $fields    The subset of post fields to return.
+	 * @param WP_Post_Type $post_type Post type object.
+	 * @param array        $fields    The subset of post fields to return.
 	 * @return array The prepared post type data.
 	 */
 	protected function _prepare_post_type( $post_type, $fields ) {
@@ -909,8 +909,8 @@ class wp_xmlrpc_server extends IXR_Server {
 		 *
 		 * @since 3.4.0
 		 *
-		 * @param array  $_post_type An array of post type data.
-		 * @param object $post_type  Post type object.
+		 * @param array        $_post_type An array of post type data.
+		 * @param WP_Post_Type $post_type  Post type object.
 		 */
 		return apply_filters( 'xmlrpc_prepare_post_type', $_post_type, $post_type );
 	}
diff --git src/wp-includes/post.php src/wp-includes/post.php
index 98aeef5..bf2b5e7 100644
--- src/wp-includes/post.php
+++ src/wp-includes/post.php
@@ -833,25 +833,19 @@ function get_post_type( $post = null ) {
 }
 
 /**
- * Retrieve a post type object by name.
+ * Retrieves a post type object by name.
  *
  * @since 3.0.0
  *
  * @global array $wp_post_types List of post types.
  *
- * @see register_post_type()
+ * @see WP_Post_Type
  *
  * @param string $post_type The name of a registered post type.
- * @return object|null A post type object.
+ * @return WP_Post_Type|null WP_Post_Type object if it exists, null otherwise.
  */
 function get_post_type_object( $post_type ) {
-	global $wp_post_types;
-
-	if ( ! is_scalar( $post_type ) || empty( $wp_post_types[ $post_type ] ) ) {
-		return null;
-	}
-
-	return $wp_post_types[ $post_type ];
+	return WP_Post_Type::get_instance( $post_type );
 }
 
 /**
@@ -892,8 +886,6 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
  * @since 4.4.0 The `show_ui` argument is now enforced on the post type listing screen and post editing screen.
  *
  * @global array      $wp_post_types List of post types.
- * @global WP_Rewrite $wp_rewrite    Used for default feeds.
- * @global WP         $wp            Used to add query vars.
  *
  * @param string $post_type Post type key, must not exceed 20 characters.
  * @param array|string $args {
@@ -993,10 +985,10 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
  *     @type string      $_edit_link           FOR INTERNAL USE ONLY! URL segment to use for edit link of
  *                                             this post type. Default 'post.php?post=%d'.
  * }
- * @return object|WP_Error The registered post type object, or an error object.
+ * @return WP_Post_Type|WP_Error The registered post type object, or an error object.
  */
 function register_post_type( $post_type, $args = array() ) {
-	global $wp_post_types, $wp_rewrite, $wp;
+	global $wp_post_types;
 
 	if ( ! is_array( $wp_post_types ) ) {
 		$wp_post_types = array();
@@ -1004,177 +996,19 @@ function register_post_type( $post_type, $args = array() ) {
 
 	// Sanitize post type name
 	$post_type = sanitize_key( $post_type );
-	$args      = wp_parse_args( $args );
-
-	/**
-	 * Filter the arguments for registering a post type.
-	 *
-	 * @since 4.4.0
-	 *
-	 * @param array  $args      Array of arguments for registering a post type.
-	 * @param string $post_type Post type key.
-	 */
-	$args = apply_filters( 'register_post_type_args', $args, $post_type );
-
-	$has_edit_link = ! empty( $args['_edit_link'] );
-
-	// Args prefixed with an underscore are reserved for internal use.
-	$defaults = array(
-		'labels'               => array(),
-		'description'          => '',
-		'public'               => false,
-		'hierarchical'         => false,
-		'exclude_from_search'  => null,
-		'publicly_queryable'   => null,
-		'show_ui'              => null,
-		'show_in_menu'         => null,
-		'show_in_nav_menus'    => null,
-		'show_in_admin_bar'    => null,
-		'menu_position'        => null,
-		'menu_icon'            => null,
-		'capability_type'      => 'post',
-		'capabilities'         => array(),
-		'map_meta_cap'         => null,
-		'supports'             => array(),
-		'register_meta_box_cb' => null,
-		'taxonomies'           => array(),
-		'has_archive'          => false,
-		'rewrite'              => true,
-		'query_var'            => true,
-		'can_export'           => true,
-		'delete_with_user'     => null,
-		'_builtin'             => false,
-		'_edit_link'           => 'post.php?post=%d',
-	);
-	$args = array_merge( $defaults, $args );
-	$args = (object) $args;
-
-	$args->name = $post_type;
 
 	if ( empty( $post_type ) || strlen( $post_type ) > 20 ) {
 		_doing_it_wrong( __FUNCTION__, __( 'Post type names must be between 1 and 20 characters in length.' ), '4.2' );
 		return new WP_Error( 'post_type_length_invalid', __( 'Post type names must be between 1 and 20 characters in length.' ) );
 	}
 
-	// If not set, default to the setting for public.
-	if ( null === $args->publicly_queryable )
-		$args->publicly_queryable = $args->public;
-
-	// If not set, default to the setting for public.
-	if ( null === $args->show_ui )
-		$args->show_ui = $args->public;
-
-	// If not set, default to the setting for show_ui.
-	if ( null === $args->show_in_menu || ! $args->show_ui )
-		$args->show_in_menu = $args->show_ui;
-
-	// If not set, default to the whether the full UI is shown.
-	if ( null === $args->show_in_admin_bar )
-		$args->show_in_admin_bar = (bool) $args->show_in_menu;
-
-	// If not set, default to the setting for public.
-	if ( null === $args->show_in_nav_menus )
-		$args->show_in_nav_menus = $args->public;
-
-	// If not set, default to true if not public, false if public.
-	if ( null === $args->exclude_from_search )
-		$args->exclude_from_search = !$args->public;
+	$post_type_object =  new WP_Post_Type( $post_type, $args);
 
-	// Back compat with quirky handling in version 3.0. #14122.
-	if ( empty( $args->capabilities ) && null === $args->map_meta_cap && in_array( $args->capability_type, array( 'post', 'page' ) ) )
-		$args->map_meta_cap = true;
-
-	// If not set, default to false.
-	if ( null === $args->map_meta_cap )
-		$args->map_meta_cap = false;
-
-	// If there's no specified edit link and no UI, remove the edit link.
-	if ( ! $args->show_ui && ! $has_edit_link ) {
-		$args->_edit_link = '';
-	}
-
-	$args->cap = get_post_type_capabilities( $args );
-	unset( $args->capabilities );
-
-	if ( is_array( $args->capability_type ) )
-		$args->capability_type = $args->capability_type[0];
-
-	if ( ! empty( $args->supports ) ) {
-		add_post_type_support( $post_type, $args->supports );
-		unset( $args->supports );
-	} elseif ( false !== $args->supports ) {
-		// Add default features
-		add_post_type_support( $post_type, array( 'title', 'editor' ) );
-	}
-
-	if ( false !== $args->query_var ) {
-		if ( true === $args->query_var )
-			$args->query_var = $post_type;
-		else
-			$args->query_var = sanitize_title_with_dashes( $args->query_var );
-
-		if ( $wp && is_post_type_viewable( $args ) ) {
-			$wp->add_query_var( $args->query_var );
-		}
-	}
-
-	if ( false !== $args->rewrite && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
-		if ( ! is_array( $args->rewrite ) )
-			$args->rewrite = array();
-		if ( empty( $args->rewrite['slug'] ) )
-			$args->rewrite['slug'] = $post_type;
-		if ( ! isset( $args->rewrite['with_front'] ) )
-			$args->rewrite['with_front'] = true;
-		if ( ! isset( $args->rewrite['pages'] ) )
-			$args->rewrite['pages'] = true;
-		if ( ! isset( $args->rewrite['feeds'] ) || ! $args->has_archive )
-			$args->rewrite['feeds'] = (bool) $args->has_archive;
-		if ( ! isset( $args->rewrite['ep_mask'] ) ) {
-			if ( isset( $args->permalink_epmask ) )
-				$args->rewrite['ep_mask'] = $args->permalink_epmask;
-			else
-				$args->rewrite['ep_mask'] = EP_PERMALINK;
-		}
-
-		if ( $args->hierarchical )
-			add_rewrite_tag( "%$post_type%", '(.+?)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&pagename=" );
-		else
-			add_rewrite_tag( "%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=" );
-
-		if ( $args->has_archive ) {
-			$archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;
-			if ( $args->rewrite['with_front'] )
-				$archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;
-			else
-				$archive_slug = $wp_rewrite->root . $archive_slug;
-
-			add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
-			if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {
-				$feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';
-				add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
-				add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
-			}
-			if ( $args->rewrite['pages'] )
-				add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );
-		}
-
-		$permastruct_args = $args->rewrite;
-		$permastruct_args['feed'] = $permastruct_args['feeds'];
-		add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $permastruct_args );
-	}
-
-	// Register the post type meta box if a custom callback was specified.
-	if ( $args->register_meta_box_cb )
-		add_action( 'add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1 );
-
-	$args->labels = get_post_type_labels( $args );
-	$args->label = $args->labels->name;
-
-	$wp_post_types[ $post_type ] = $args;
+	$wp_post_types[ $post_type ] = $post_type_object;
 
 	add_action( 'future_' . $post_type, '_future_post_hook', 5, 2 );
 
-	foreach ( $args->taxonomies as $taxonomy ) {
+	foreach ( $post_type_object->taxonomies as $taxonomy ) {
 		register_taxonomy_for_object_type( $taxonomy, $post_type );
 	}
 
@@ -1188,7 +1022,7 @@ function register_post_type( $post_type, $args = array() ) {
 	 */
 	do_action( 'registered_post_type', $post_type, $args );
 
-	return $args;
+	return $post_type_object;
 }
 
 /**
@@ -1439,7 +1273,7 @@ function _post_type_meta_capabilities( $capabilities = null ) {
  *
  * @access private
  *
- * @param object $post_type_object Post type object.
+ * @param object|WP_Post_Type $post_type_object Custom-something object or WP_Post_Type object.
  * @return object object with all the labels as member variables.
  */
 function get_post_type_labels( $post_type_object ) {
diff --git src/wp-settings.php src/wp-settings.php
index a4bb370..e2034b2 100644
--- src/wp-settings.php
+++ src/wp-settings.php
@@ -142,6 +142,7 @@ require( ABSPATH . WPINC . '/author-template.php' );
 require( ABSPATH . WPINC . '/post.php' );
 require( ABSPATH . WPINC . '/class-walker-page.php' );
 require( ABSPATH . WPINC . '/class-walker-page-dropdown.php' );
+require( ABSPATH . WPINC . '/class-wp-post-type.php' );
 require( ABSPATH . WPINC . '/class-wp-post.php' );
 require( ABSPATH . WPINC . '/post-template.php' );
 require( ABSPATH . WPINC . '/revision.php' );
diff --git tests/phpunit/tests/post/types.php tests/phpunit/tests/post/types.php
index f216ec5..795f7c3 100644
--- tests/phpunit/tests/post/types.php
+++ tests/phpunit/tests/post/types.php
@@ -29,7 +29,7 @@ class Tests_Post_Types extends WP_UnitTestCase {
 		register_post_type( 'foo' );
 
 		$pobj = get_post_type_object( 'foo' );
-		$this->assertInstanceOf( 'stdClass', $pobj );
+		$this->assertInstanceOf( 'WP_Post_Type', $pobj );
 		$this->assertEquals( 'foo', $pobj->name );
 
 		// Test some defaults
@@ -554,7 +554,7 @@ class Tests_Post_Types extends WP_UnitTestCase {
 	 * @since 4.5.0
 	 *
 	 * @param array $args register_post_type() arguments.
-	 * @return stdClass Post type object for `$this->post_type`.
+	 * @return WP_Post_Type Post type object for `$this->post_type`.
 	 */
 	public function register_post_type( $args = array() ) {
 		register_post_type( $this->post_type, $args );
diff --git tests/phpunit/tests/post/wpPostType.php tests/phpunit/tests/post/wpPostType.php
new file mode 100644
index 0000000..6542454
--- /dev/null
+++ tests/phpunit/tests/post/wpPostType.php
@@ -0,0 +1,18 @@
+<?php
+
+/**
+ * @group post
+ */
+class Tests_WP_Post_Type extends WP_UnitTestCase {
+	public function test_get_instance() {
+		$post = WP_Post_Type::get_instance( 'post' );
+
+		$this->assertInstanceOf( 'WP_Post_Type', $post );
+		$this->assertEquals( 'post', $post->name );
+
+		$page = WP_Post_Type::get_instance( 'page' );
+
+		$this->assertInstanceOf( 'WP_Post_Type', $page );
+		$this->assertEquals( 'page', $page->name );
+	}
+}
