mirror of
git://develop.git.wordpress.org/
synced 2025-01-31 12:29:09 +01:00
Customizer: Avoid PHP notices after [32806].
props adamsilverstein, westonruter. fixes #32781. git-svn-id: https://develop.svn.wordpress.org/trunk@33035 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
ef9f9c1a24
commit
2ef2ac5e93
@ -753,17 +753,17 @@ final class WP_Customize_Nav_Menus {
|
||||
$args['instance_number'] = $this->preview_nav_menu_instance_number;
|
||||
|
||||
$can_partial_refresh = (
|
||||
$args['echo']
|
||||
! empty( $args['echo'] )
|
||||
&&
|
||||
is_string( $args['fallback_cb'] )
|
||||
( empty( $args['fallback_cb'] ) || is_string( $args['fallback_cb'] ) )
|
||||
&&
|
||||
is_string( $args['walker'] )
|
||||
( empty( $args['walker'] ) || is_string( $args['walker'] ) )
|
||||
);
|
||||
$args['can_partial_refresh'] = $can_partial_refresh;
|
||||
|
||||
if ( ! $can_partial_refresh ) {
|
||||
unset( $args['fallback_cb'] );
|
||||
unset( $args['walker'] );
|
||||
$args['fallback_cb'] = '';
|
||||
$args['walker'] = '';
|
||||
}
|
||||
|
||||
ksort( $args );
|
||||
|
@ -308,7 +308,7 @@ function wp_nav_menu( $args = array() ) {
|
||||
* - Otherwise, bail.
|
||||
*/
|
||||
if ( ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) && !$args->theme_location ) )
|
||||
&& $args->fallback_cb && is_callable( $args->fallback_cb ) )
|
||||
&& isset( $args->fallback_cb ) && $args->fallback_cb && is_callable( $args->fallback_cb ) )
|
||||
return call_user_func( $args->fallback_cb, (array) $args );
|
||||
|
||||
if ( ! $menu || is_wp_error( $menu ) )
|
||||
|
Loading…
x
Reference in New Issue
Block a user