PHP code example of snicco / wp-guests-only-middleware
1. Go to this page and download the library: Download snicco/wp-guests-only-middleware library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
snicco / wp-guests-only-middleware example snippets
// Assumes you have configured an alias for "guests-only" => WPGuestsOnly::class
// A logged-in user will now be redirected to /foo.
$configurator->get('route1', '/route1', SomeController::class)
->middleware('guests-only:/foo');