From 94d3f6c838ec25ed172c0379bac1852349707807 Mon Sep 17 00:00:00 2001 From: Genyus Date: Wed, 11 Nov 2026 00:23:43 -0400 Subject: [PATCH] fix(academy): show posts of any date on the Content Board --- .../cbf-content-board-all-dates.php | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 web/app/mu-plugins/cbf-content-board-all-dates.php 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 +);