From 55692a6e6b03fdc988bf4ab633c2d5f6e7810730 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Wed, 13 Jul 2016 15:23:04 +0000 Subject: [PATCH] Docs: Add and clarify changelog entries for elements that can now accept, use, or return `WP_Post_Type` objects. Also adds a missing initial `@since` version for `wp_xmlrpc_server::_prepare_post_type()`. See [37890]. See #36217. git-svn-id: https://develop.svn.wordpress.org/trunk@38051 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/nav-menu.php | 2 ++ src/wp-includes/class-wp-post-type.php | 2 ++ src/wp-includes/class-wp-xmlrpc-server.php | 3 +++ src/wp-includes/post.php | 8 ++++++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/includes/nav-menu.php b/src/wp-admin/includes/nav-menu.php index cb5b3b2b8e..41f3cdd384 100644 --- a/src/wp-admin/includes/nav-menu.php +++ b/src/wp-admin/includes/nav-menu.php @@ -519,6 +519,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { * to the slug of the current post type. * * @since 3.2.0 + * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * * @see WP_Query::query() * @@ -527,6 +528,7 @@ function wp_nav_menu_item_post_type_meta_box( $object, $post_type ) { * @param WP_Post_Type $post_type The current post type object for this menu item meta box. */ $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type ); + $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args ); if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) { diff --git a/src/wp-includes/class-wp-post-type.php b/src/wp-includes/class-wp-post-type.php index 6aeab9bbd4..5be7a16ed4 100644 --- a/src/wp-includes/class-wp-post-type.php +++ b/src/wp-includes/class-wp-post-type.php @@ -11,6 +11,8 @@ * Core class used for interacting with post types. * * @since 4.6.0 + * + * @see register_post_type() */ final class WP_Post_Type { /** diff --git a/src/wp-includes/class-wp-xmlrpc-server.php b/src/wp-includes/class-wp-xmlrpc-server.php index 2d68e46fb0..48b18a4f2f 100644 --- a/src/wp-includes/class-wp-xmlrpc-server.php +++ b/src/wp-includes/class-wp-xmlrpc-server.php @@ -881,6 +881,8 @@ class wp_xmlrpc_server extends IXR_Server { /** * Prepares post data for return in an XML-RPC object. * + * @since 3.4.0 + * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * @access protected * * @param WP_Post_Type $post_type Post type object. @@ -921,6 +923,7 @@ class wp_xmlrpc_server extends IXR_Server { * Filters XML-RPC-prepared date for the given post type. * * @since 3.4.0 + * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * * @param array $_post_type An array of post type data. * @param WP_Post_Type $post_type Post type object. diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index f752b4c20f..26a588ba23 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -837,6 +837,7 @@ function get_post_type( $post = null ) { * Retrieves a post type object by name. * * @since 3.0.0 + * @since 4.6.0 Converted to use WP_Post_Type. * * @global array $wp_post_types List of post types. * @@ -899,7 +900,7 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) * @since 3.0.0 The `show_ui` argument is now enforced on the new post screen. * @since 4.4.0 The `show_ui` argument is now enforced on the post type listing * screen and post editing screen. - * @since 4.6.0 Converted to use `WP_Post_Type`. + * @since 4.6.0 Converted to use WP_Post_Type. * * @global array $wp_post_types List of post types. * @@ -1041,6 +1042,7 @@ function register_post_type( $post_type, $args = array() ) { * Fires after a post type is registered. * * @since 3.3.0 + * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * * @param string $post_type Post type. * @param WP_Post_Type $post_type_object Arguments used to register the post type. @@ -1056,7 +1058,7 @@ function register_post_type( $post_type, $args = array() ) { * Can not be used to unregister built-in post types. * * @since 4.5.0 - * @since 4.6.0 Converted to use `WP_Post_Type`. + * @since 4.6.0 Converted to use WP_Post_Type. * * @global array $wp_post_types List of post types. * @@ -1265,6 +1267,7 @@ function _post_type_meta_capabilities( $capabilities = null ) { * and `use_featured_image` labels. * @since 4.4.0 Added the `insert_into_item`, `uploaded_to_this_item`, `filter_items_list`, * `items_list_navigation`, and `items_list` labels. + * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * * @access private * @@ -1522,6 +1525,7 @@ function set_post_type( $post_id = 0, $post_type = 'post' ) { * * @since 4.4.0 * @since 4.5.0 Added the ability to pass a post type name in addition to object. + * @since 4.6.0 Converted the `$post_type` parameter to accept a WP_Post_Type object. * * @param string|WP_Post_Type $post_type Post type name or object. * @return bool Whether the post type should be considered viewable.