Issue:
Notice: Only variable references should be returned by reference at (references server directory)/POST.PHP at Line 2006
Steps to reproduce:
1.) File upload PHP script added to custom page template.
2.) Upload a file via PHP script
Expected results:
Page updates normally
Actual results:
Notice: Only variable references should be returned by reference at (references server directory)/POST.PHP at Line 2006
Solution:
Reviewing Line 2006 results in the following code:
======================================================
Current code from 2.6.1
======================================================
if ( $cache = wp_cache_get( 'get_pages', 'posts' ) )
if ( isset( $cache[ $key ] ) )
return apply_filters('get_pages', $cache[ $key ], $r );
======================================================
Proposed code
======================================================
if ( $cache = wp_cache_get( 'get_pages', 'posts' ) )
if ( isset( $cache[ $key ] ) )
{
$retval = apply_filters('get_pages', $cache[ $key ], $r );
return $retval;
}