- Timestamp:
- 12/12/2021 02:09:02 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/classes/class-bp-notifications-notification.php
r13147 r13184 849 849 * We use BP_Date_Query, which extends WP_Date_Query, to do the heavy lifting 850 850 * of parsing the date_query array and creating the necessary SQL clauses. 851 * However, since BP_Notifications_Notification::get() builds its SQL852 * differently than WP_Query, we have to alter the return value (stripping853 * the leading AND keyword from the query).854 851 * 855 852 * @since 2.3.0 … … 860 857 */ 861 858 public static function get_date_query_sql( $date_query = array() ) { 862 863 // Bail if not a proper date query format. 864 if ( empty( $date_query ) || ! is_array( $date_query ) ) { 865 return ''; 866 } 867 868 // Date query. 869 $date_query = new BP_Date_Query( $date_query, 'date_notified' ); 870 871 // Strip the leading AND - it's handled in get(). 872 return preg_replace( '/^\sAND/', '', $date_query->get_sql() ); 859 return BP_Date_Query::get_where_sql( $date_query, 'n.date_notified' ); 873 860 } 874 861
Note: See TracChangeset
for help on using the changeset viewer.