1,665 reputation
1622
bio website
location Devon, United Kingdom
age 33
visits member for 3 years, 6 months
seen May 20 at 8:57

May
20
awarded  Popular Question
May
14
comment What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
Good find, that does indeed work. Hopefully the WP powers-that-be will listen and make the minor adjustments necessary to include this functionality.
May
14
comment What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
Cool, I'll just add my thoughts to hose then.
May
14
comment What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
Although I've marked this as the answer because it does address my initial query and should make my site more efficient.
May
14
accepted What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
May
14
comment What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
Ha ha, yep, been playing around for ages. I can see now why it's not working, but surly a valid case for checking is_front_page() is when manipulating the query? I'm strongly leaning towards opening a ticket on Trac, with the suggestion that they use code similar to my solution, as that should work in all instances.
May
14
revised What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
added 403 characters in body
May
14
comment What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
But $q->is_front_page() doesn't work, it always returns a notice and false, no matter what page I am on. And for using $q against the other examples, presumably that is desirable because the core functions is_home(), etc. use the global $wp_query, rather than it being my code that uses an undesirable global?
May
14
comment What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
Thanks for this. I've now added the second argument (kind of embarrased I missed that!), meaning I can do away with the global in my fgw_is_front_page() function. However, trying to use $q->is_front_page(), as in your example, still results in the notice posted in my question (this time for all of my filters though) and the result of false.
May
14
revised What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
Added update
May
14
asked What is the correct method for determining 'is_front_page' when using filters such as 'pre_get_posts' and 'posts_where'?
May
5
comment Wordpress Jquery UI Spinner
@FranciscoCorralesMorales - Typically when using core scripts there is no need to declare dependencies, as the scripts are pre-registered with them out of the box; the pre-registered script jquery-ui-spinner already has jquery-ui-core as a dependency, which in turn has jquery. The main idea of dependencies is for when you register/enqueue custom scripts.
May
4
revised Add a custom tab alongside Screen Options and Help
added 121 characters in body
May
4
comment Add a custom tab alongside Screen Options and Help
And do you know where I can find that question, and if it has an accepted answer? The closest I have found is a hack using JS from 2010, which I believe is pre-WP_Screen (in it's current format anyway).
May
4
asked Add a custom tab alongside Screen Options and Help
Apr
22
answered How do I get the category slug from wp_dropdown_categories
Apr
22
revised Filter custom post type by custom taxomony
deleted 1775 characters in body
Apr
22
answered Filter custom post type by custom taxomony
Apr
22
asked Filter custom post type by custom taxomony
Apr
16
awarded  Excavator