{"action":"closed","issue":{"url":"https://api.github.com/repos/jarednova/timber/issues/779","labels_url":"https://api.github.com/repos/jarednova/timber/issues/779/labels{/name}","comments_url":"https://api.github.com/repos/jarednova/timber/issues/779/comments","events_url":"https://api.github.com/repos/jarednova/timber/issues/779/events","html_url":"https://github.com/jarednova/timber/issues/779","id":121251214,"number":779,"title":"Does Timber interfere with is_main_query() ?","user":{"login":"lmartins","id":151981,"avatar_url":"https://avatars.githubusercontent.com/u/151981?v=3","gravatar_id":"","url":"https://api.github.com/users/lmartins","html_url":"https://github.com/lmartins","followers_url":"https://api.github.com/users/lmartins/followers","following_url":"https://api.github.com/users/lmartins/following{/other_user}","gists_url":"https://api.github.com/users/lmartins/gists{/gist_id}","starred_url":"https://api.github.com/users/lmartins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmartins/subscriptions","organizations_url":"https://api.github.com/users/lmartins/orgs","repos_url":"https://api.github.com/users/lmartins/repos","events_url":"https://api.github.com/users/lmartins/events{/privacy}","received_events_url":"https://api.github.com/users/lmartins/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-09T14:24:28Z","updated_at":"2015-12-15T16:21:35Z","closed_at":"2015-12-15T16:21:35Z","body":"Hi,\r\n\r\nIm facing a problem where a function, hooked into `pre_get_posts` always returns the following notice:\r\n```\r\nNotice: Trying to get property of non-object in /Users/luismartins/Sites/webipack.dev/wp-includes/query.php on line 4660\r\n```\r\n\r\nThis refers to my code as follows:\r\n```php\r\nadd_action( 'pre_get_posts', 'mw_modify_query_limit_products' );\r\n\r\nfunction mw_modify_query_limit_products( $query ) {\r\n\r\n\tif( ! is_admin() && $query->is_main_query() && is_woocommerce() ) {\r\n        var_dump( $query );\r\n\t     $query->set('posts_per_page', get_option( 'tc_list_products_perpage', 12 ) );\r\n\t}\r\n\r\n}\r\n```\r\nMore specifically to this part of it `$query->is_main_query()`.\r\n\r\nDoes Timber interfere in any way with this hook?\r\n\r\nThanks.\r\n"}}