Created
August 7, 2018 20:35
-
-
Save mjangda/387aaf4f44204a0f6235db91aaca8dcb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'init', function() { | |
$html_map = [ | |
'howdy/world' => 'howdy', | |
]; | |
$current_path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ); | |
if ( in_array( $current_path, array_keys( $html_map ), true ) ) { | |
$filename = $html_map[ $current_path ]; | |
$contents = file_get_contents( __DIR__ . '/docs/' . $filename . '.html'; | |
echo $contents; | |
exit; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment