Title: PHP Warning line 13 re $post_type
Last modified: August 21, 2016

---

# PHP Warning line 13 re $post_type

 *  [Youdaman](https://wordpress.org/support/users/youdaman/)
 * (@youdaman)
 * [12 years ago](https://wordpress.org/support/topic/php-warning-line-13-re-post_type/)
 * `Warning: array_key_exists() [function.array-key-exists]: The first argument 
   should be either a string or an integer ... /wp-content/plugins/wp-admin-hide-
   others-posts/wp-admin-hide-others-posts.php on line 13`
 * Just a heads up that a client of mine was receiving the following warning.
 * I fixed it by quoting the $post_type e.g.
 *     ```
       public static function filter_post_type($post_type){
       		return array_key_exists("$post_type", get_option('wp_hide_others_posts_enabled'));
       	}
       ```
   
 * That seems to stop it throwing the warning.
 * Thanks for such a great plugin btw 🙂
 * [https://wordpress.org/plugins/wp-admin-hide-others-posts/](https://wordpress.org/plugins/wp-admin-hide-others-posts/)

The topic ‘PHP Warning line 13 re $post_type’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-admin-hide-others-posts.svg)
 * [WP Admin Hide Other's Posts](https://wordpress.org/plugins/wp-admin-hide-others-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-admin-hide-others-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-admin-hide-others-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-admin-hide-others-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-admin-hide-others-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-admin-hide-others-posts/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [Youdaman](https://wordpress.org/support/users/youdaman/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/php-warning-line-13-re-post_type/)
 * Status: not resolved