mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-22 23:41:38 +01:00
Set taxonomy label if none given.
git-svn-id: http://svn.automattic.com/wordpress/trunk@13258 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4d203a02c6
commit
94a42d9ba2
@ -209,6 +209,7 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
|||||||
'query_var' => $taxonomy,
|
'query_var' => $taxonomy,
|
||||||
'public' => true,
|
'public' => true,
|
||||||
'show_ui' => null,
|
'show_ui' => null,
|
||||||
|
'label' => null,
|
||||||
'_builtin' => false
|
'_builtin' => false
|
||||||
);
|
);
|
||||||
$args = wp_parse_args($args, $defaults);
|
$args = wp_parse_args($args, $defaults);
|
||||||
@ -234,6 +235,9 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
|||||||
if ( is_null($args['show_ui']) )
|
if ( is_null($args['show_ui']) )
|
||||||
$args['show_ui'] = $args['public'];
|
$args['show_ui'] = $args['public'];
|
||||||
|
|
||||||
|
if ( is_null($args['label'] ) )
|
||||||
|
$args['label'] = $taxonomy;
|
||||||
|
|
||||||
foreach ( array('manage_cap', 'edit_cap', 'delete_cap') as $cap ) {
|
foreach ( array('manage_cap', 'edit_cap', 'delete_cap') as $cap ) {
|
||||||
if ( empty($args[$cap]) )
|
if ( empty($args[$cap]) )
|
||||||
$args[$cap] = 'manage_categories';
|
$args[$cap] = 'manage_categories';
|
||||||
|
Loading…
Reference in New Issue
Block a user