Title: [Plugin: More Types] Wrong datatype?
Last modified: August 19, 2016

---

# [Plugin: More Types] Wrong datatype?

 *  [dgodfather](https://wordpress.org/support/users/dgodfather/)
 * (@dgodfather)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/)
 * Warning: in_array() [function.in-array]: Wrong datatype for second argument in…/
   wp-content/plugins/more-types/more-types-settings.php on line 291
 * [http://wordpress.org/extend/plugins/more-types/](http://wordpress.org/extend/plugins/more-types/)

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/page/2/?output_format=md)

 *  [Sven Peeters](https://wordpress.org/support/users/svenpeeters/)
 * (@svenpeeters)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936036)
 * I’ve got the same error
 *  [thomasjbradley](https://wordpress.org/support/users/thomasjbradley/)
 * (@thomasjbradley)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936134)
 * Yep, same issue.
 * Appears on all the settings pages for a specific type.
 *  [davidb64il](https://wordpress.org/support/users/davidb64il/)
 * (@davidb64il)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936185)
 * I got it as well.
 *  [digitalley](https://wordpress.org/support/users/digitalley/)
 * (@digitalley)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936249)
 * Same here>
    Wordpress 3.1 upgrade and Multisite enabled. It happens when I open
   up the “More types” from settings in sidebar. “Warning: in_array() [function.
   in-array]: Wrong datatype for second argument in /home/hs0cgfpq/public_html/wp-
   content/plugins/more-types/more-types-settings.php on line 291”
 * Any Ideas?
 *  [admazy](https://wordpress.org/support/users/admazy/)
 * (@admazy)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936263)
 * any fix?
 *  [mediaperfection](https://wordpress.org/support/users/mediaperfection/)
 * (@mediaperfection)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936304)
 * Try This:
    Paste the following code after line 182 in more-types-object.php: 
   $options[‘show_in_menu’] = true; $options[‘capability_type’] = ‘post’;
 * [http://more-plugins.se/forum/topic/more-types-new-post-type-not-appearing-on-left-side-admin-menu](http://more-plugins.se/forum/topic/more-types-new-post-type-not-appearing-on-left-side-admin-menu)
 *  Thread Starter [dgodfather](https://wordpress.org/support/users/dgodfather/)
 * (@dgodfather)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936307)
 * So this should be line 183 & 184 respectively?
 *  [jay-august](https://wordpress.org/support/users/jay-august/)
 * (@jay-august)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936363)
 * Although not a perfect fix, I did manage to get rid of the error by editing `
   more-type-settings.php` from line 285 – 296 to this:
 *     ```
       $tax = array();
               $stax = array();
               $mytax = $more_types_settings->get_val('taxonomies');
               foreach($wp_taxonomies as $taxonomy) {
                   if (!trim($taxonomy->label)) continue;
                   $tax[$taxonomy->name] = $taxonomy->label;
                   if(is_array($mytax)) {
                   if (in_array($taxonomy->name, $mytax)) $stax[] = $taxonomy;
                   } else {
                       $stax[] = NULL;
                   }
               }
       ```
   
 * This is =not= a perfect fix, but it did got rid of the error. I’m not 100% sure
   how your custom taxonomies will respond to this!
 *  [jay-august](https://wordpress.org/support/users/jay-august/)
 * (@jay-august)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936365)
 * Errr… don’t do this 🙂 It will wreck your site, sorry.
 *  [TrevorNet](https://wordpress.org/support/users/trevornet/)
 * (@trevornet)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936483)
 * This worked for me. And by worked, I mean the errors are not showing up and the
   plug-in continues to work. Right above more-types-settings.php >> 291…
 *     ```
       if(!isset($mytax)) {
          $mytax = array();
       } else if(!is_array($mytax)) {
          settype($mytax, "array");
       }
       ```
   
 * This should not interfere with the plug-in (I think) as we are simply forcing
   $mytax into an array-type. If $mytax already exists as an array, nothing will
   change. The original in_array() test on 291 will have the proper conditions needed
   to complete it’s task.
 *  Thread Starter [dgodfather](https://wordpress.org/support/users/dgodfather/)
 * (@dgodfather)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936486)
 * Thanks TrevorNet, that does get rid of the errors for sure. I’ll let you know
   if I run across other errors.
 *  [Tammy Hart](https://wordpress.org/support/users/tammyhart/)
 * (@tammyhart)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936575)
 * Working for me here. Will report errors if encountered.
 *  [Volker E.](https://wordpress.org/support/users/volker_e-1/)
 * (@volker_e-1)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936599)
 * [@trevornet](https://wordpress.org/support/users/trevornet/)’s fix works for 
   me too (WP 3.1.1/More Types 1.1).
 *  [awpile](https://wordpress.org/support/users/awpile/)
 * (@awpile)
 * [15 years ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936611)
 * [@trevornet](https://wordpress.org/support/users/trevornet/)’s fix also worked
   for me (WP 3.1.1 with two sites networked).
 * Just to be clear, lines 285-292 originally look like this:
 * >  $tax = array();
   >  $stax = array(); $mytax = $more_types_settings->get_val(‘
   > taxonomies’); foreach($wp_taxonomies as $taxonomy) { if (!trim($taxonomy->label))
   > continue; $tax[$taxonomy->name] = $taxonomy->label; if (in_array($taxonomy-
   > >name, $mytax)) $stax[] = $taxonomy; }
 * You add in [@trevornet](https://wordpress.org/support/users/trevornet/)’s code
   to line 291, pushing what’s on 291 down. So the above block of code now looks
   like this:
 * >  $tax = array();
   >  $stax = array(); $mytax = $more_types_settings->get_val(‘
   > taxonomies’); foreach($wp_taxonomies as $taxonomy) { if (!trim($taxonomy->label))
   > continue; $tax[$taxonomy->name] = $taxonomy->label; if(!isset($mytax)) { $mytax
   > = array(); } else if(!is_array($mytax)) { settype($mytax, “array”); } if (in_array(
   > $taxonomy->name, $mytax)) $stax[] = $taxonomy; }
 *  [rajaito](https://wordpress.org/support/users/rajaito/)
 * (@rajaito)
 * [15 years ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/#post-1936614)
 * [@awpile](https://wordpress.org/support/users/awpile/) – this worked for me :
   0)

Viewing 15 replies - 1 through 15 (of 19 total)

1 [2](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/page/2/?output_format=md)

The topic ‘[Plugin: More Types] Wrong datatype?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/more-types.svg)
 * [More Types](https://wordpress.org/plugins/more-types/)
 * [Support Threads](https://wordpress.org/support/plugin/more-types/)
 * [Active Topics](https://wordpress.org/support/plugin/more-types/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/more-types/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/more-types/reviews/)

 * 19 replies
 * 17 participants
 * Last reply from: [potel](https://wordpress.org/support/users/potel/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/plugin-more-types-wrong-datatype/page/2/#post-1936670)
 * Status: not resolved