Skip to content

Instantly share code, notes, and snippets.

@kovshenin
Created November 30, 2011 09:22
Show Gist options
  • Save kovshenin/1408498 to your computer and use it in GitHub Desktop.
Save kovshenin/1408498 to your computer and use it in GitHub Desktop.
function filter_where_this_week( $where ) {
$where .= " AND post_date >= '" . date( 'Y-m-d 00:00:00', strtotime( '-7 days', current_time( 'timestamp' ) ) ) . "' AND post_date < '" . date( 'Y-m-d 23:59:59', strtotime( '+0 days', current_time( 'timestamp' ) ) ) . "' ";
return $where;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment