From 8a9b76d0aa8f141819bdef5f7e3404e5146314a4 Mon Sep 17 00:00:00 2001 From: Drew Jaynes Date: Tue, 28 Jun 2016 06:26:40 +0000 Subject: [PATCH] Docs: Improve the usefulness, accuracy, and syntax of the `register_post_type()` DocBlock summary and description. See #32246. git-svn-id: https://develop.svn.wordpress.org/trunk@37882 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index fd5a48b9e0..dbb8925533 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -882,11 +882,18 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) } /** - * Register a post type. Do not use before init. + * Registers a post type. * - * A function for creating or modifying a post type based on the - * parameters given. The function will accept an array (second optional - * parameter), along with a string for the post type name. + * Note: Post type registrations should not be hooked before the + * {@see 'init'} action. Also, any taxonomy connections should be + * registered via the `$taxonomies` argument to ensure consistency + * when hooks such as {@see 'parse_query'} or {@see 'pre_get_posts'} + * are used. + * + * Post types can support any number of built-in core features such + * as meta boxes, custom fields, post thumbnails, post statuses, + * comments, and more. See the `$supports` argument for a complete + * list of supported features. * * @since 2.9.0 * @since 3.0.0 The `show_ui` argument is now enforced on the new post screen.