diff --git a/web/app/mu-plugins/cbf-content-board-all-dates.php b/web/app/mu-plugins/cbf-content-board-all-dates.php new file mode 100644 index 00000000..e505513e --- /dev/null +++ b/web/app/mu-plugins/cbf-content-board-all-dates.php @@ -0,0 +1,60 @@ +get( 'cbf_content_board_range' ) : null; + + if ( ! is_array( $range ) || count( $range ) !== 2 ) { + return $where; + } + + // The same condition PublishPress builds in posts_where_range(). + $condition = $wpdb->prepare( + " AND ($wpdb->posts.post_date >= %s AND $wpdb->posts.post_date < %s)", + gmdate( 'Y-m-d', strtotime( $range[0] ) ) . ' 00:00:00', + gmdate( 'Y-m-d', strtotime( $range[1] ) ) . ' 23:59:59' + ); + + return str_replace( $condition, '', $where ); + }, + // After PublishPress's own posts_where filter, at the default priority. + 11, + 2 +);