The bricks/maintenance/should_apply
Filter does in fact let users bypass the maintenance mode as expected, but when the option inside the bricks settings to render popups
is NOT selected, users that bypass the maintenance mode don’t see those popups.
In my opinion, people that bypass the maintenance mode, should get the same site-experience as if the maintentance mode is not active, meaning popups should not be disabled for users that bypass the maintenance mode.
tested with this code-snippet:
// MARK: Maintenance bypass
add_filter('bricks/maintenance/should_apply', function ($apply_maintenance, $mode) {
$valid_key = 'uf';
$cookie_name = 'uf_maintenance_bypass';
// Check preview key in URL
if (isset($_GET['bypass']) && $_GET['bypass'] === $valid_key) {
// Set a cookie for 1 hour
setcookie($cookie_name, $valid_key, time() + 365 * DAY_IN_SECONDS, COOKIEPATH, COOKIE_DOMAIN);
return false;
}
// Check cookie on subsequent requests
if (isset($_COOKIE[$cookie_name]) && $_COOKIE[$cookie_name] === $valid_key) {
return false;
}
return $apply_maintenance;
}, 10, 2);