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
This commit is contained in:
parent
079d7eb56e
commit
385b98d828
@ -1103,7 +1103,7 @@ class WP_Customize_Nav_Menu_Item_Setting extends WP_Customize_Setting {
|
|||||||
$i = 1;
|
$i = 1;
|
||||||
|
|
||||||
foreach ( $items as $k => $item ) {
|
foreach ( $items as $k => $item ) {
|
||||||
$items[ $k ]->$args['output_key'] = $i++;
|
$items[ $k ]->{$args['output_key']} = $i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,7 +638,7 @@ function wp_get_nav_menu_items( $menu, $args = array() ) {
|
|||||||
usort($items, '_sort_nav_menu_items');
|
usort($items, '_sort_nav_menu_items');
|
||||||
$i = 1;
|
$i = 1;
|
||||||
foreach( $items as $k => $item ) {
|
foreach( $items as $k => $item ) {
|
||||||
$items[$k]->$args['output_key'] = $i++;
|
$items[$k]->{$args['output_key']} = $i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user