WordPress filter hook
get_date_sql_clauses
Fired by 6 WordPress plugins, running on 73K+ sites between them.
How to use get_date_sql_clauses
It's a filter: your callback receives the value and 1 more argument, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'get_date_sql_clauses', function( $sql, $object ) {
// Change $sql here.
return $sql;
}, 10, 2 );Argument names come from Easy Digital Downloads's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
6 plugins that fire get_date_sql_clauses
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
Easy Digital Downloads40,000+ installs
apply_filters( 'get_date_sql_clauses', $sql, $this )src/Database/Queries/Date.php:661 -
Sugar Calendar10,000+ installs
apply_filters( 'get_date_sql_clauses', $sql, $this )includes/classes/database/engine/Queries/Date.php:684 -
Stripe Payment Forms by WP Simple Pay8,000+ installs
apply_filters( 'get_date_sql_clauses', $sql, $this )lib/BerlinDB/Database/Queries/Date.php:684 -
Membership Plugin8,000+ installs
apply_filters( 'get_date_sql_clauses', $sql, $this )core/includes/database/engine/class-date.php:579 -
Tablesome Table7,000+ installs
apply_filters( 'get_date_sql_clauses', $sql, $this )includes/lib/berlin-db/core/date.php:684 -
Plays Block40+ installs
apply_filters( 'get_date_sql_clauses', $sql, $this )includes/core/engine/Queries/Date.php:685
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.