Avoid a notice by casting $args['rewrite']
to array()
before adding a slug
property and running array_merge()
.
Fixes #23668. git-svn-id: https://develop.svn.wordpress.org/trunk@25351 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
23d3b372d7
commit
d091e1d0b7
@ -352,13 +352,17 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
|
if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
|
||||||
|
if ( ! is_array( $args['rewrite'] ) )
|
||||||
|
$args['rewrite'] = array();
|
||||||
|
|
||||||
if ( empty( $args['rewrite']['slug'] ) )
|
if ( empty( $args['rewrite']['slug'] ) )
|
||||||
$args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy );
|
$args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy );
|
||||||
$args['rewrite'] = wp_parse_args( $args['rewrite'], array(
|
|
||||||
|
$args['rewrite'] = array_merge( array(
|
||||||
'with_front' => true,
|
'with_front' => true,
|
||||||
'hierarchical' => false,
|
'hierarchical' => false,
|
||||||
'ep_mask' => EP_NONE,
|
'ep_mask' => EP_NONE,
|
||||||
) );
|
), $args['rewrite'] );
|
||||||
|
|
||||||
if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] )
|
if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] )
|
||||||
$tag = '(.+?)';
|
$tag = '(.+?)';
|
||||||
|
Loading…
Reference in New Issue
Block a user