Avoid 'Only variables should be passed by reference' warnings. Props SergeyBiryukov. see #18975

git-svn-id: http://svn.automattic.com/wordpress/trunk@19074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-10-28 15:48:44 +00:00
parent 9c4728942f
commit 31e3ff3fb1
4 changed files with 8 additions and 4 deletions

View File

@ -860,7 +860,8 @@ case 'add-meta' :
'supplemental' => array('postid' => $pid)
) );
} else { // Update?
$mid = (int) array_pop( $var_by_ref = array_keys($_POST['meta']) );
$var_by_ref = array_keys( $_POST['meta'] );
$mid = (int) array_pop( $var_by_ref );
$key = stripslashes( $_POST['meta'][$mid]['key'] );
$value = stripslashes( $_POST['meta'][$mid]['value'] );
if ( '' == trim($key) )

View File

@ -337,7 +337,8 @@ function _wp_ajax_menu_quick_search( $request = array() ) {
while ( have_posts() ) {
the_post();
if ( 'markup' == $response_format ) {
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $var_by_ref = get_the_ID() ) ) ), 0, (object) $args );
$var_by_ref = get_the_ID();
echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $var_by_ref ) ) ), 0, (object) $args );
} elseif ( 'json' == $response_format ) {
echo json_encode(
array(

View File

@ -223,7 +223,8 @@ class AtomServer {
*/
function __construct() {
$this->script_name = array_pop( $var_by_ref = explode( '/', $_SERVER['SCRIPT_NAME'] ) );
$var_by_ref = explode( '/', $_SERVER['SCRIPT_NAME'] );
$this->script_name = array_pop( $var_by_ref );
$this->app_base = site_url( $this->script_name . '/' );
$this->selectors = array(

View File

@ -1386,7 +1386,8 @@ class wpdb {
// Return an array of row objects with keys from column 1
// (Duplicates are discarded)
foreach ( $this->last_result as $row ) {
$key = array_shift( $var_by_ref = get_object_vars( $row ) );
$var_by_ref = get_object_vars( $row );
$key = array_shift( $var_by_ref );
if ( ! isset( $new_array[ $key ] ) )
$new_array[ $key ] = $row;
}