Ready to get started?Download WordPress


[resolved] Behavior of the 'posts_search' filter has changed (4 posts)

  1. David Lingren
    Posted 10 months ago #

    In WordPress version 3.6.1 and earlier, the "posts_search" filter was applied unconditionally, i.e., even when the "s" query argument was empty. You can see this in lines 2215-2216 of wp-includes/query.php, which are outside the "if ( !empty($q['s'] ) )" block of code which precedes it.

    In version '3.7-RC1-25851', the 'posts_search' filter has been moved into a new function, "parse_search" (wp-includes/query.php lines 1917- 1971), which is only executed if the "$q['s']" argument is not empty.

    This makes it impossible for a plugin to add a search clause to a query which does not have one to begin with. It is a change in filter behavior from earlier versions, which state that the filter will "Allow plugins to contextually add/remove/modify the search section of the database query".

    Please move the filter back to its original location after the "if ( !empty($q['s'] ) )" block and before the "// Taxonomies" block which follows it.

  2. Sergey Biryukov
    WordPress Dev
    Posted 10 months ago #

    Thanks for reporting, created a Trac ticket: http://core.trac.wordpress.org/ticket/25664.

  3. Mushviq Abdulla
    Posted 10 months ago #

    Здравствуйте Сергей. Я присоединился к команде WordPress из Азербайджана. Переводы Азербайджанского языка WordPress,имеет большое количество ошибок. Пожалуйста, помогите мне, чтобы исправить эти ошибки. Орфографические и грамматические ошибки в переводах очень достаточно. Хотел бы поблагодарить ранее.

  4. Sergey Biryukov
    WordPress Dev
    Posted 9 months ago #

    Mushviq Abdulla, you should submit a request on the Polyglots blog to create an Azerbaijani translation team if it doesn't exist yet.


You must log in to post.

About this Topic