Title: PHP Notice:  Array to string conversion in wp-includes/post.php
Last modified: August 22, 2016

---

# PHP Notice: Array to string conversion in wp-includes/post.php

 *  Resolved [VGJ](https://wordpress.org/support/users/vgj/)
 * (@vgj)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/php-notice-array-to-string-conversion-in-wp-includespostphp/)
 * I have found a PHP Notice (Array to string conversion in wp-includes/post.php)
   when using strict. The notice is for cpt-onomies/manager.php at line 340. It 
   seems that there does not seem to be any thought of `$query->query['post_type']`
   being an array. It fails at `post_type_exists( $query->query[ 'post_type' ] )`.
   The function post_type_exists() returns a boolean based on get_post_type_object()
   which forces the passed variable into a string.
 * You can see below:
 *     ```
       function post_type_exists( $post_type ) {
              return (bool) get_post_type_object( $post_type );
       }
   
       function get_post_type_object( $post_type ) {
               global $wp_post_types;
   
               <strong>if ( empty($wp_post_types["" . $post_type]) )</strong>
                       return null;
   
               return $wp_post_types[$post_type];
       }
       ```
   
 * I just wanted to bring this to your attention. I am thinking that if it is an
   array check if more than one type. If it is not, than send the string. If it 
   is than check if it only contains one item. If so, return that string for the
   check. If it is larger …. ??? Maybe just exit as cpt-onomies would not work?
 * [https://wordpress.org/plugins/cpt-onomies/](https://wordpress.org/plugins/cpt-onomies/)

Viewing 1 replies (of 1 total)

 *  [Rachel Cherry](https://wordpress.org/support/users/bamadesigner/)
 * (@bamadesigner)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/php-notice-array-to-string-conversion-in-wp-includespostphp/#post-5690317)
 * Have you updated to 1.3.3 that I released this morning? It should take care of
   this. Please let me know if it does not.
 * Thanks for letting me know!

Viewing 1 replies (of 1 total)

The topic ‘PHP Notice: Array to string conversion in wp-includes/post.php’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cpt-onomies_f2f2f2.svg)
 * [CPT-onomies: Using Custom Post Types as Taxonomies](https://wordpress.org/plugins/cpt-onomies/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cpt-onomies/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cpt-onomies/)
 * [Active Topics](https://wordpress.org/support/plugin/cpt-onomies/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cpt-onomies/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cpt-onomies/reviews/)

## Tags

 * [Array to String Conversion](https://wordpress.org/support/topic-tag/array-to-string-conversion/)
 * [strict notice](https://wordpress.org/support/topic-tag/strict-notice/)

 * 1 reply
 * 2 participants
 * Last reply from: [Rachel Cherry](https://wordpress.org/support/users/bamadesigner/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/php-notice-array-to-string-conversion-in-wp-includespostphp/#post-5690317)
 * Status: resolved