Make WordPress Core

Changeset 33035


Ignore:
Timestamp:
07/01/2015 07:07:20 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Customizer: Avoid PHP notices after [32806].

props adamsilverstein, westonruter.
fixes #32781.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r32895 r33035  
    754754
    755755        $can_partial_refresh = (
    756             $args['echo']
     756            ! empty( $args['echo'] )
    757757            &&
    758             is_string( $args['fallback_cb'] )
     758            ( empty( $args['fallback_cb'] ) || is_string( $args['fallback_cb'] ) )
    759759            &&
    760             is_string( $args['walker'] )
     760            ( empty( $args['walker'] ) || is_string( $args['walker'] ) )
    761761        );
    762762        $args['can_partial_refresh'] = $can_partial_refresh;
    763763
    764764        if ( ! $can_partial_refresh ) {
    765             unset( $args['fallback_cb'] );
    766             unset( $args['walker'] );
     765            $args['fallback_cb'] = '';
     766            $args['walker'] = '';
    767767        }
    768768
  • trunk/src/wp-includes/nav-menu-template.php

    r32803 r33035  
    309309     */
    310310    if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )
    311         && $args->fallback_cb && is_callable( $args->fallback_cb ) )
     311        && isset( $args->fallback_cb ) && $args->fallback_cb && is_callable( $args->fallback_cb ) )
    312312            return call_user_func( $args->fallback_cb, (array) $args );
    313313
Note: See TracChangeset for help on using the changeset viewer.