#21526 closed defect (bug) (wontfix)
get_post_type_capabilities() assumes $args->capabilities is an array
Reported by: | wpsmith | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Role/Capability | Keywords: | |
Focuses: | Cc: |
Description
get_post_type_capabilities() assumes $args->capabilities is an array and should check and confirm it. Otherwise a warning appears: Warning: array_merge() [function.array-merge]: Argument # 2 is not an array in /home/username/public_html/wp-includes/post.php on line 1183. I discovered this when I accidentally set this to null instead of array().
Type setting it seems to clear the warning, if we want to clear the warning.
$capabilities = array_merge( $default_capabilities, (array)$args->capabilities );
Attachments (1)
Change History (6)
Note: See
TracTickets for help on using
tickets.
This feels like a user error, and a error that should be left in place so that Developers *know* they've passed something wrong in..