WordPress.org

Make WordPress Core

Changeset 19074


Ignore:
Timestamp:
10/28/11 15:48:44 (3 years ago)
Author:
ryan
Message:

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

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r19007 r19074  
    861861        ) ); 
    862862    } else { // Update? 
    863         $mid = (int) array_pop( $var_by_ref = array_keys($_POST['meta']) ); 
     863        $var_by_ref = array_keys( $_POST['meta'] ); 
     864        $mid = (int) array_pop( $var_by_ref ); 
    864865        $key = stripslashes( $_POST['meta'][$mid]['key'] ); 
    865866        $value = stripslashes( $_POST['meta'][$mid]['value'] ); 
  • trunk/wp-admin/includes/nav-menu.php

    r19028 r19074  
    338338                the_post(); 
    339339                if ( 'markup' == $response_format ) { 
    340                     echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $var_by_ref = get_the_ID() ) ) ), 0, (object) $args ); 
     340                    $var_by_ref = get_the_ID(); 
     341                    echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', array( get_post( $var_by_ref ) ) ), 0, (object) $args ); 
    341342                } elseif ( 'json' == $response_format ) { 
    342343                    echo json_encode( 
  • trunk/wp-app.php

    r18998 r19074  
    224224    function __construct() { 
    225225 
    226         $this->script_name = array_pop( $var_by_ref = explode( '/', $_SERVER['SCRIPT_NAME'] ) ); 
     226        $var_by_ref = explode( '/', $_SERVER['SCRIPT_NAME'] ); 
     227        $this->script_name = array_pop( $var_by_ref ); 
    227228        $this->app_base = site_url( $this->script_name . '/' ); 
    228229 
  • trunk/wp-includes/wp-db.php

    r19060 r19074  
    13871387            // (Duplicates are discarded) 
    13881388            foreach ( $this->last_result as $row ) { 
    1389                 $key = array_shift( $var_by_ref = get_object_vars( $row ) ); 
     1389                $var_by_ref = get_object_vars( $row ); 
     1390                $key = array_shift( $var_by_ref ); 
    13901391                if ( ! isset( $new_array[ $key ] ) ) 
    13911392                    $new_array[ $key ] = $row; 
Note: See TracChangeset for help on using the changeset viewer.