From 385b98d8284294ccf426af5321622c97f8d5a4bc Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Sun, 26 Jul 2015 18:03:58 +0000 Subject: [PATCH] Use explicit variable variable syntax PHP7 introduces a backwards compatable change to variable varibale syntax that requires us to use curly brackets to maintain the syntax between php5 and php7. For more info, see https://wiki.php.net/rfc/uniform_variable_syntax#semantic_differences_in_existing_syntax for the semantic differences. Props ocean90 Fixes #31982 git-svn-id: https://develop.svn.wordpress.org/trunk@33427 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-customize-setting.php | 2 +- src/wp-includes/nav-menu.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/class-wp-customize-setting.php b/src/wp-includes/class-wp-customize-setting.php index e9ca5bf348..fa943464a1 100644 --- a/src/wp-includes/class-wp-customize-setting.php +++ b/src/wp-includes/class-wp-customize-setting.php @@ -1103,7 +1103,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting { $i = 1; foreach ( $items as $k => $item ) { - $items[ $k ]->$args['output_key'] = $i++; + $items[ $k ]->{$args['output_key']} = $i++; } } diff --git a/src/wp-includes/nav-menu.php b/src/wp-includes/nav-menu.php index 9061acedd1..d12abc55d9 100644 --- a/src/wp-includes/nav-menu.php +++ b/src/wp-includes/nav-menu.php @@ -638,7 +638,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) { usort($items, '_sort_nav_menu_items'); $i = 1; foreach( $items as $k => $item ) { - $items[$k]->$args['output_key'] = $i++; + $items[$k]->{$args['output_key']} = $i++; } }