I’m trying to get rid of this warning from my wordpress installation.
Strict Standards: Only variables should be passed by reference in xxxxx on line 67
The line with the “faulty code” is this one
$wp_theme_name = next(explode('/themes/', $stylesheet_directory_uri));
However, if I do pass the value per reference as requested, the WP doesn’t load anymore.
Can you please help me to understand how to fix this?
Thanks
Andrea
This occurs because you do the
explode()
call inside thenext()
call. The reason I think is, by strict standards you shouldn’t pass a function to a function like this, because, like @AndrewBartel said, of reference, which would be missing. Doing it like shown below should work and would be correct: