Title: parameter 2 to be array
Last modified: January 16, 2020

---

# parameter 2 to be array

 *  Resolved [jotooga](https://wordpress.org/support/users/jotooga/)
 * (@jotooga)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/parameter-2-to-be-array/)
 * After installing the plugin . I get an error on top of the dashbord page as follows
   “
   _parameter 2 to be array, string given in /home/tooga/public\_html/wp-content/
   plugins/wp-sort-order/inc/hooks.php on line 873_“<br/> Below copy of Hooks.php
   file starting on line 869 taken from my cpanel:<br/> **********************************************************
   868-$wpso_objects = isset( $wpso_options[‘objects’] ) ? $wpso_options[‘objects’]:
   array(); 869- 870- 871- global $wpdb; 872- 873- if(!$post->menu_order && in_array(
   $post->post_type, $wpso_objects )){ 874- $sql = ‘SELECT MAX(menu_order) FROM ‘.
   $wpdb->posts.’ 875- WHERE post_type = “‘.$post->post_type.'” ‘; $max = $wpdb-
   >get_var($sql); if($max>0){ wp_update_post(array( ‘ID’=>$post->ID, ‘menu_order’
   =>$max+1 ));
 *  }
    }
 *  }
 *  add_action(‘admin_footer’, ‘wpso_admin_scripts’, 100);
    function wpso_admin_scripts(){
   global $wpso_allowed_pages; ************************************************ 
   Can u kindly help with the change of coding since I do not have enough knowledge
   on php. Many thanks

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

 *  Plugin Author [Fahad Mahmood](https://wordpress.org/support/users/fahadmahmood/)
 * (@fahadmahmood)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/parameter-2-to-be-array/#post-12333476)
 * [@jotooga](https://wordpress.org/support/users/jotooga/) don’t worry, i will 
   check it and resolve this notice/warning in next release. Don’t worry, it’s an
   error which will disturb your website.
 *  [hastibe](https://wordpress.org/support/users/hastibe/)
 * (@hastibe)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/parameter-2-to-be-array/#post-12868314)
 * Came here to post the same thing–getting this warning in the debug.log:
 * `PHP Warning: in_array() expects parameter 2 to be array, string given in .../
   wp-content/plugins/wp-sort-order/inc/hooks.php on line 873`
 * Even if it doesn’t impact the functionality of the plugin, if this could be fixed
   so it doesn’t fill up the debug.log with the warnings, that would be appreciated.
 *  Plugin Author [Fahad Mahmood](https://wordpress.org/support/users/fahadmahmood/)
 * (@fahadmahmood)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/parameter-2-to-be-array/#post-12869844)
 * [@hastibe](https://wordpress.org/support/users/hastibe/) it has been corrected,
   you will get it in next release. Thank you for this contribution.
 *  [hastibe](https://wordpress.org/support/users/hastibe/)
 * (@hastibe)
 * [6 years, 1 month ago](https://wordpress.org/support/topic/parameter-2-to-be-array/#post-12871193)
 * Great–thank you!

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

The topic ‘parameter 2 to be array’ is closed to new replies.

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

 * 4 replies
 * 3 participants
 * Last reply from: [hastibe](https://wordpress.org/support/users/hastibe/)
 * Last activity: [6 years, 1 month ago](https://wordpress.org/support/topic/parameter-2-to-be-array/#post-12871193)
 * Status: resolved