I am writing a plugin, and want to show an about page, but without a post/page record. So if, the url is entered, my 'hardcoded' content is shown.
A bit like the login page, there is no login post, but the login screen displays.
Which hooks would I need to use to catch the url, and then output my content without getting a 404?
I am writing a plugin, and want to show an about page, but without a post/page record. So if, the url https://example/about is entered, my 'hardcoded' content is shown.
A bit like the login page, there is no login post, but the login screen displays.
Which hooks would I need to use to catch the url, and then output my content without getting a 404?
Share Improve this question asked Oct 2, 2020 at 17:29 StripyTigerStripyTiger 2771 silver badge6 bronze badges1 Answer
Reset to default 1you can try 'request' hook:
add_filter('request', function( $vars ) {
$request = urldecode($_SERVER['REQUEST_URI']);
if ( stristr($request, '/YOUR_SLUG') != false ) {
...
}
}