[wp-trac] [WordPress Trac] #21526: get_post_type_capabilities() assumes $args->capabilities is an array
WordPress Trac
wp-trac at lists.automattic.com
Thu Aug 9 12:29:05 UTC 2012
#21526: get_post_type_capabilities() assumes $args->capabilities is an array
-----------------------------+-----------------------------
Reporter: wpsmith | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Role/Capability | Version:
Severity: normal | Keywords:
-----------------------------+-----------------------------
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 );
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21526>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list