#13843 closed enhancement (wontfix)
post_type_supports() returns true when $_wp_post_type_features['post_type']['feature'] is set but false
Reported by: | linguasite | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Posts, Post Types | Keywords: | 2nd-opinion |
Focuses: | Cc: |
Description
Wouldn't it be safer to ask for a true value before returning true?
I had to change a capability manually and did this by directly changing the relevant value to false (without using remove_post_type_support for some reason).
post_type_supports() still returned true then.
wp-includes/post.php line 1031
Change History (4)
Note: See
TracTickets for help on using
tickets.
You should use remove_post_type_support(). Modifying the internal array is not supported. Via add_post_type_support(), it will always equal either true, or an array. We could check for === false there, but I don't think we should need to. It's set, that's what matters. The "true" is just to have a value there (as with pluggable arg checking, it could be more than just "true").