Remove unused arguments (hierarchical, _edit_link, capability_type) from register_post_status

Props scribu, simonwheatley. Fixes #18578, #18972.


git-svn-id: https://develop.svn.wordpress.org/trunk@21302 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jon Cave 2012-07-22 08:45:35 +00:00
parent a95752402e
commit 708d475b96
1 changed files with 16 additions and 2 deletions

View File

@ -671,7 +671,21 @@ function register_post_status($post_status, $args = array()) {
$wp_post_statuses = array();
// Args prefixed with an underscore are reserved for internal use.
$defaults = array('label' => false, 'label_count' => false, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => null, 'internal' => null, 'protected' => null, 'private' => null, 'show_in_admin_all' => null, 'publicly_queryable' => null, 'show_in_admin_status_list' => null, 'show_in_admin_all_list' => null, 'single_view_cap' => null);
$defaults = array(
'label' => false,
'label_count' => false,
'exclude_from_search' => null,
'_builtin' => false,
'public' => null,
'internal' => null,
'protected' => null,
'private' => null,
'show_in_admin_all' => null,
'publicly_queryable' => null,
'show_in_admin_status_list' => null,
'show_in_admin_all_list' => null,
'single_view_cap' => null,
);
$args = wp_parse_args($args, $defaults);
$args = (object) $args;
@ -703,7 +717,7 @@ function register_post_status($post_status, $args = array()) {
$args->show_in_admin_all_list = !$args->internal;
if ( null === $args->show_in_admin_status_list )
$args->show_in_admin_status_list = !$args->internal;
$args->show_in_admin_status_list = !$args->internal;
if ( null === $args->single_view_cap )
$args->single_view_cap = $args->public ? '' : 'edit';