Title: error using is_humans()
Last modified: August 20, 2016

---

# error using is_humans()

 *  Resolved [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years ago](https://wordpress.org/support/topic/error-using-is_humans/)
 * I’m trying to add support for your plugin to [WP-HTML-Compression](http://wordpress.org/extend/plugins/wp-html-compression/),
   but I’m getting this error:
 * `Fatal error: Call to a member function get() on a non-object in /wordpress/wp-
   includes/query.php on line 27`
 * I’m calling it in my plugin file, not in any filter/action.
 * [http://wordpress.org/extend/plugins/humanstxt/](http://wordpress.org/extend/plugins/humanstxt/)

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

 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [13 years ago](https://wordpress.org/support/topic/error-using-is_humans/#post-3599049)
 * Could you send me the link to your code where you call `is_humans()`?
 *  Thread Starter [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years ago](https://wordpress.org/support/topic/error-using-is_humans/#post-3599066)
 * A link wouldn’t do you any good as the only thing on the page is the error mentioned
   above. This is the erroneous code:
 *     ```
       if (function_exists('is_admin'))
       {
       	$is_humans = (!function_exists('is_humans')) ? false : is_humans();
   
       	if (!is_admin() && !$is_humans)
       	{
       		add_action('template_redirect', 'wp_html_compression_start', -1);
   
       		// In case above fails (it does sometimes.. ??)
       		add_action('get_header', 'wp_html_compression_start');
       	}
       }
       ```
   
 * If I comment out the `$is_humans` line, it works without error; however, humans.
   txt gets compressed.
 *  Plugin Author [Till Krüss](https://wordpress.org/support/users/tillkruess/)
 * (@tillkruess)
 * [13 years ago](https://wordpress.org/support/topic/error-using-is_humans/#post-3599110)
 * You’re calling `is_humans()` before `$wp_query` is initialized. The earliest 
   you can call it, is with the `setup_theme` action, that’s when the WordPress 
   Object `$wp = new WP();` has been initialized in `wp-settings.php`.
 * Best thing to do in your case is to call `is_humans()` in your `wp_html_compression_start()`,
   the `template_redirect` action is perfect for that.
 *  Thread Starter [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years ago](https://wordpress.org/support/topic/error-using-is_humans/#post-3599121)
 * Ahh, ok. I rarely work with the wp database, and never work with any other dbs;
   not my thing.
 * Thanks for the suggestion; I’ll do that!

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

The topic ‘error using is_humans()’ is closed to new replies.

 * ![](https://ps.w.org/humanstxt/assets/icon-256x256.png?rev=971564)
 * [Humans TXT](https://wordpress.org/plugins/humanstxt/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/humanstxt/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/humanstxt/)
 * [Active Topics](https://wordpress.org/support/plugin/humanstxt/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/humanstxt/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/humanstxt/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/error-using-is_humans/#post-3599121)
 * Status: resolved