Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [WORDPRESS] Remove div IF textarea is empty for Events Post Type Function Re: [WORDPRESS] Remove div IF textarea is empty for Events Post Type Function

#138793
__
Participant

>Even if $event_info is empty the text “INFO” still appears.

What I’m getting at is that, if you see “INFO”, that means that `$event_info` was _not_ empty, even though you expected it to be. `var_dump` lets us see the value that `$event_info` contained: a string, 33 characters long. Since we only see 15 characters displayed, I’m assuming the other 18 are HTML markup or whitespace of some sort.

Try viewing the HTML source of your webpage, and look for the full value after `string(33)`. Copy+paste it, please.

>This happens. It removes my container and all the events …

Right, because I had you do `exit;`. It’s not a solution, it’s a test. Because we exit the script, then the value we dumped should be the _last_ bit of text on your webpage (easier to find that way).