Title: Warning: in_array() expects parameter 2 error
Last modified: January 21, 2018

---

# Warning: in_array() expects parameter 2 error

 *  Resolved [antsinpants](https://wordpress.org/support/users/antsinpants/)
 * (@antsinpants)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/warning-in_array-expects-parameter-2-error/)
 * Hello!
    This plugin looks like I am looking for, but unf. doen’t work with my
   blog. I created “latest post” block and then try to insert the code to the page
   When I preview it I see following warnings
 * Warning: in_array() expects parameter 2 to be array, null given in /var/www/admin/
   www/ants-in-pants.com/wp-content/plugins/wp-latest-posts/inc/wplp-front.inc.php
   on line 362
 * Warning: Invalid argument supplied for foreach() in /var/www/admin/www/ants-in-
   pants.com/wp-content/plugins/wp-latest-posts/inc/wplp-front.inc.php on line 364
 * Warning: in_array() expects parameter 2 to be array, null given in /var/www/admin/
   www/ants-in-pants.com/wp-content/plugins/wp-latest-posts/inc/wplp-front.inc.php
   on line 362
 * Warning: Invalid argument supplied for foreach() in /var/www/admin/www/ants-in-
   pants.com/wp-content/plugins/wp-latest-posts/inc/wplp-front.inc.php on line 364
 * and then a lot of symbols like that �3{<�”l�y���’Hǎ�^�@8��
 * If you can help me or suggest would be great.
 * thanks in advance
    -  This topic was modified 8 years, 4 months ago by [antsinpants](https://wordpress.org/support/users/antsinpants/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwarning-in_array-expects-parameter-2-error%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [JoomUnited](https://wordpress.org/support/users/joomunited/)
 * (@joomunited)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/warning-in_array-expects-parameter-2-error/#post-9886911)
 * Hi,
 * Thanks for reporting.
    Do you have a testing page where we can see that?
 * Could you try to disable the error report and see if the character problem persist?
 * Thanks.
 *  Thread Starter [antsinpants](https://wordpress.org/support/users/antsinpants/)
 * (@antsinpants)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/warning-in_array-expects-parameter-2-error/#post-9886932)
 * Hello,
 * thank you for the response
 * I made a test page [https://ants-in-pants.com/en/test-2/](https://ants-in-pants.com/en/test-2/)
 * Can you tell me where I can disable the error report? In wp-config.php or somewhere
   in plugin settings? Because in config I have define(‘WP_DEBUG’, false);
 * Thanks
    -  This reply was modified 8 years, 4 months ago by [antsinpants](https://wordpress.org/support/users/antsinpants/).
    -  This reply was modified 8 years, 4 months ago by [antsinpants](https://wordpress.org/support/users/antsinpants/).
 *  Plugin Author [JoomUnited](https://wordpress.org/support/users/joomunited/)
 * (@joomunited)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/warning-in_array-expects-parameter-2-error/#post-9888143)
 * Hi,
 * The page don’t seems to have the plugin loaded, maybe you changed something in
   the meantime?
    About the error report you can: – Try this one: [https://aristath.github.io/blog/wp-hide-php-errors](https://aristath.github.io/blog/wp-hide-php-errors)
   OR, better – Disable it from your hosting service, some of them offer to configure
   some PHP variable (search in your cpanel, each hosting have different interface)
 * Thanks!
 *  Thread Starter [antsinpants](https://wordpress.org/support/users/antsinpants/)
 * (@antsinpants)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/warning-in_array-expects-parameter-2-error/#post-9896551)
 * Hello.
    Thanks for the response. What do you mean “The page don’t seems to have
   the plugin loaded” I installed the plugin from WP admin dashboard and didn’t 
   change anything.
 * About article I read exactly the same 🙂 As I told, I checked config file. It
   was
    define(‘WP_DEBUG’, false);
 * Now I changed to advanced code
 * ini_set(‘display_errors’,’Off’);
    ini_set(‘error_reporting’, E_ALL ); define(‘
   WP_DEBUG’, false); define(‘WP_DEBUG_DISPLAY’, false);
 * Symbols disappeared. I don not how it is critical, lets see.
 * Thanks

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Warning: in_array() expects parameter 2 error’ is closed to new replies.

 * ![](https://ps.w.org/wp-latest-posts/assets/icon-256x256.png?rev=1900564)
 * [WP Latest Posts](https://wordpress.org/plugins/wp-latest-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-latest-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-latest-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-latest-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-latest-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-latest-posts/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [antsinpants](https://wordpress.org/support/users/antsinpants/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/warning-in_array-expects-parameter-2-error/#post-9896551)
 * Status: resolved