Ok, I’m stupid. I figured it was something simple.
In my function, I should have used return
instead of echo
. I was under the impression that echo
was what’s normally used since every example or tutorial I found on the internet for writing php functions used echo
. At least now it makes more sense.