Skip to content

Instantly share code, notes, and snippets.

View scottfoster's full-sized avatar

Scott Foster scottfoster

View GitHub Profile
@jasonbahl
jasonbahl / disable-frontent.php
Last active January 9, 2024 13:30
Disable frontend but allow REST, CRON and GraphQL Requests
<?php
add_action( 'parse_request', 'disable_front_end', 99 );
function disable_front_end() {
global $wp;
/**
* If the request is not part of a CRON, REST Request, GraphQL Request or Admin request,