Skip to main contentSkip to footer

I’m sorry to report 2.9.2 was a buggy update. It had a very small bug — just an add_action() call to a non-existing function — with very large consequences. Fortunately nothing permanent, so a quick upgrade to 2.9.3 will fix this.

Your account

Not logged in. Log in to see your license details.

Search

Popular Resources

Natural-language date queries

…= date( ‘d’, $time ); $date_query = array( ‘month’ => $month, ‘day’ => $day, ); if ( $use_year ) { $date_query[‘year’] = $year; } $query->set( ‘date_query’, $date_query ); $query->query_vars[‘s’] = ”; } return $query; } The solution is simple. The search query ($query->query_vars[‘s’]) is fed to PHP’s strtotime() function, which…I just wanted to be able to type in a date on the search and for the search to come up with all the blog posts for that date. This is one of those tasks that sounds really simple, but is actually complicated. However, this question piqued my interest and……converts an English-language string to a timestamp. If the search query converts to a timestamp, the timestamp is converted into a date and used for a date query. The function also checks if the year appears in the query. If it doesn’t, the year isn’t used. Yearless dates are converted…

Related Posts:

Comment Section:

1 Comment. Leave new

  • thank you for the quick reaction. fortunately I remembered I updated relevanssi and concluded the mess on the site was caused by 2.9.2.
    best regards
    fmh

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed