Skip to content

Instantly share code, notes, and snippets.

Avatar
😄

Katrina Yancey yanceyk

😄
View GitHub Profile
@yanceyk
yanceyk / functions.php
Last active Dec 10, 2020
Prevent direct access via URL to a WordPress page
View functions.php
<?php
function prefix_no_direct_access() {
// Define Page URL for redirect.
$careers = get_permalink( get_page_by_title( 'Careers' ) );
// If this is not the Apply Now page, do nothing.
if( ! is_page( 'Apply Now' ) ) {
return;
}