• Hello all,

    Just after spending many hours resolving why a feature broke on the upgrade to WP4.0.

    I had an add_filter call on ‘pre_get_posts’. this allows $query to be updated/modified before the query is done.

    Whereas post_type was an argument 14 months back – it now appears to be not set by default. This broke my functionality.

    For those looking for the resolution to this problem – the fix is $query->set(‘post_type’, ‘custom_post_name’) – if you are using something like add_filter(‘posts_results’, “call_my_function”)

    Question : anyone know what version of WP this changed in ? I have not been able to find it?

    Many Thanks!

  • The topic ‘post_type dropped from $query – when?’ is closed to new replies.