get_date_sql
Filters the date query WHERE clause.
Usage
add_filter( 'get_date_sql', 'wp_kama_get_date_sql_filter', 10, 2 );
/**
* Function for `get_date_sql` filter-hook.
*
* @param string $where WHERE clause of the date query.
* @param WP_Date_Query $query The WP_Date_Query instance.
*
* @return string
*/
function wp_kama_get_date_sql_filter( $where, $query ){
// filter...
return $where;
}
- $where(string)
- WHERE clause of the date query.
- $query(WP_Date_Query)
- The WP_Date_Query instance.
Changelog
| Since 3.7.0 | Introduced. |
Where the hook is called
get_date_sql
wp-includes/class-wp-date-query.php 578
return apply_filters( 'get_date_sql', $where, $this );