I’m having the same issue. I have an option on a link, a checkbox to say, “Open in new window”. When it’s checked, I use:
$new = get_field("new_window");
to return whether this is set or not. If I do:
I get an error telling me second variable in in_array must be array
If I do
if(strpos($new, 'set') !== false)
I get an error telling me first variable must be a string. PHP eh?!
For whatever reason, I can’t do:
if($new == 'set')
as this always returns false. A var_dump of the $new variable shows it is indeed an array.
Edited: Actually, I should clarify, these are PHP notices, not errors. I’m not too worried, but I would like to resolve. If the answer is “Because, PHP” well then, that’s it…
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!