Make WordPress Core

Changeset 25351


Ignore:
Timestamp:
09/11/2013 05:17:00 PM (11 years ago)
Author:
wonderboymusic
Message:

Avoid a notice by casting $args['rewrite'] to array() before adding a slug property and running array_merge().

Fixes #23668.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src

    • Property svn:ignore set to
      .wp-tests-version
  • trunk/src/wp-includes/taxonomy.php

    r25335 r25351  
    353353
    354354    if ( false !== $args['rewrite'] && ( is_admin() || '' != get_option( 'permalink_structure' ) ) ) {
     355        if ( ! is_array( $args['rewrite'] ) )
     356            $args['rewrite'] = array();
     357
    355358        if ( empty( $args['rewrite']['slug'] ) )
    356359            $args['rewrite']['slug'] = sanitize_title_with_dashes( $taxonomy );
    357         $args['rewrite'] = wp_parse_args( $args['rewrite'], array(
     360
     361        $args['rewrite'] = array_merge( array(
    358362            'with_front' => true,
    359363            'hierarchical' => false,
    360364            'ep_mask' => EP_NONE,
    361         ) );
     365        ), $args['rewrite'] );
    362366
    363367        if ( $args['hierarchical'] && $args['rewrite']['hierarchical'] )
Note: See TracChangeset for help on using the changeset viewer.