Filter hook 'get_date_sql'

in WP Core File wp-includes/class-wp-date-query.php at line 567

View Source

get_date_sql

Filter Hook
Description
Filters the date query WHERE clause.

Hook Information

File Location wp-includes/class-wp-date-query.php View on GitHub
Hook Type Filter
Line Number 567

Hook Parameters

Type Name Description
string $where WHERE clause of the date query.
WP_Date_Query $query The WP_Date_Query instance.

Usage Examples

Basic Usage
<?php
// Hook into get_date_sql
add_filter('get_date_sql', 'my_custom_filter', 10, 2);

function my_custom_filter($where, $query) {
    // Your custom filtering logic here
    return $where;
}

Source Code Context

wp-includes/class-wp-date-query.php:567 - How this hook is used in WordPress core
<?php
 562  		 * @since 3.7.0
 563  		 *
 564  		 * @param string        $where WHERE clause of the date query.
 565  		 * @param WP_Date_Query $query The WP_Date_Query instance.
 566  		 */
 567  		return apply_filters( 'get_date_sql', $where, $this );
 568  	}
 569  
 570  	/**
 571  	 * Generates SQL clauses to be appended to a main query.
 572  	 *

PHP Documentation

<?php
/**
		 * Filters the date query WHERE clause.
		 *
		 * @since 3.7.0
		 *
		 * @param string        $where WHERE clause of the date query.
		 * @param WP_Date_Query $query The WP_Date_Query instance.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/class-wp-date-query.php
Related Hooks

Related hooks will be displayed here in future updates.