From a9cb64b53709a7917f2fd7610cb1103a0e5f2ee8 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 4 Sep 2013 05:11:09 +0000 Subject: [PATCH] Avoid 'Only variables should be passed by reference' notice on Widgets screen. props jdgrimes. fixes #25225. Built from https://develop.svn.wordpress.org/trunk@25226 git-svn-id: http://core.svn.wordpress.org/trunk@25196 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/widgets.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/widgets.php b/wp-admin/widgets.php index 3e0b14621d..8be2a087fa 100644 --- a/wp-admin/widgets.php +++ b/wp-admin/widgets.php @@ -182,7 +182,8 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { if ( isset($_GET['addnew']) ) { // Default to the first sidebar - $sidebar = array_shift( $keys = array_keys($wp_registered_sidebars) ); + $keys = array_keys( $wp_registered_sidebars ); + $sidebar = array_shift( $keys ); if ( isset($_GET['base']) && isset($_GET['num']) ) { // multi-widget // Copy minimal info from an existing instance of this widget to a new instance