Posts: Introduce WP_Post_Type and use it in register_post_type() and unregister_post_type().

This changes the global `$wp_post_types` to an array of `WP_Post_Type` objects. `WP_Post_Type` includes methods to handle post type supports, rewrite rules, meta boxes, hooks, and taxonomies.
Each post type argument becomes a property of `WP_Post_Type`.

Props swissspidy, flixos90.
Fixes #36217.

git-svn-id: https://develop.svn.wordpress.org/trunk@37890 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2016-06-28 16:40:33 +00:00
parent 78eb45a959
commit bded47a1b6
10 changed files with 883 additions and 241 deletions

View File

@@ -883,8 +883,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 ) {
@@ -922,8 +922,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 );
}