I recently came across an interesting warning on one of my WordPress sites. The warning was “Strict Standards: Only variables should be passed by reference” and was referring to line 14. As you can see below, I wasnt’ really sure what the issue was here.

After a big of research, I found that array_pop requires an array in a variable as the functions is initiated with a reference variable which means the function will return the last item in the array and update the passed variable without the last item. PHP.net have a great example that explains this further.

To fix my issue, I had to update line 14 as follows:

Hope this helps you!

Published by Seagyn

I'm a passionate "Maker of Things" and build as often as I can. I build things with mainly with PHP and a little Javascript. View more posts

Leave a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.