Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing argument type for supports in register_post_type() #5537

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -1641,15 +1641,15 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
* See get_post_type_capabilities().
* @type bool $map_meta_cap Whether to use the internal default meta capability handling.
* Default false.
* @type array $supports Core feature(s) the post type supports. Serves as an alias for calling
* @type array|bool $supports Core feature(s) the post type supports. Serves as an alias for calling
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @type array|bool $supports Core feature(s) the post type supports. Serves as an alias for calling
* @type array|false $supports Core feature(s) the post type supports. Serves as an alias for calling

Let's make it explicit that only false is supported, not true

* add_post_type_support() directly. Core features include 'title',
* 'editor', 'comments', 'revisions', 'trackbacks', 'author', 'excerpt',
* 'page-attributes', 'thumbnail', 'custom-fields', and 'post-formats'.
* Additionally, the 'revisions' feature dictates whether the post type
* will store revisions, and the 'comments' feature dictates whether the
* comments count will show on the edit screen. A feature can also be
* specified as an array of arguments to provide additional information
* about supporting that feature.
* about supporting that feature. If false, no features will be added.
* Example: `array( 'my_feature', array( 'field' => 'value' ) )`.
* Default is an array containing 'title' and 'editor'.
* @type callable $register_meta_box_cb Provide a callback function that sets up the meta boxes for the
Expand Down