I am using the ACF plugin which is awesome but am struggling with a feature of it, namely the checkbox.

I am trying to use the checkbox as a means of promoting a blog post to a 'top story'.

So I have set up a ACF checkbox field called 'top\_story' and if it is checked it should promote the post and if it is not checked then it won't promote the post.

Now this does work but I keep getting the following error message whenever a blog post does not have that checkbox ticked.

**Warning: in\_array() [function.in-array]: Wrong datatype for second argument**

I have simplified the code so it looks like this:

```
<?php
if( in_array( 'topstory', get_field('top_story') ) )
{
echo '<h1>This is a top story</h1>'; 
}
else
{
echo '<h1>This isn't a top story</h1>';
}
?>

```

So I guess what I want to know is what is going wrong here and how to rectify it? It looks like as there is no value in the array for the posts which aren't 'top stories' then there is no argument passed into the 'get-field' function and it falls over?

I was just going to hide the errors as essentially it still works but that doesn't sit comfortable with me and I'm sure I will need to do this again in the future.

Thanks for all your time and help in advance.