0

I'm seeing this error message at the top of my website:

Warning: in_array() expects parameter 2 to be array, null given in /home1/santikac/public_html/wp-content/plugins/jetpack/class.jetpack.php on line 1518

How do I resolve this warning?

Nicholas Sizer
  • 3,490
  • 3
  • 26
  • 29
  • this means, on your wordpress, you have plugin call "jetpack" who have huge error. If this plugin is not necessary on your website, just delete it, if is necessary then update it. – Yanis-git Apr 17 '18 at 11:12
  • This is helpful. I am no longer seeing the warning message on the dashboard (back end). But I am still seeing the warning message on the website. – Hasan Suyat Apr 17 '18 at 11:31
  • 1
    is because plugin is running on frontend (website) only. Just disable it. – Yanis-git Apr 17 '18 at 11:36

1 Answers1

0

The function in_array() accepts two parameters -

  1. The string to be matched in the array
  2. The array itself

Also, there is an optional parameter -

  1. $strict = FALSE;

Let's take an example:

$valueToSearch = "abc";
$arrayToSearch = array("acb", "abc", "dce");
echo in_array($valueToSearch, $arrayToSearch);

If you inspect the warning properly it tells you the method and the line number where the issue is coming. You can navigate to that particular line and try print_r() with the variable passed to in_array() and resolve the issue. If not, update your question with the outputs of print_r().

kaushal agrawal
  • 360
  • 3
  • 21