On my WordPress site, I would like to create "virtual" page. By virtual page I mean the content that I can link to by URL. I'm using Facebook Webhooks and I would like to have a callback URL like this: https://example.com/facebook-webhook
. I'd like it to be done via plugin, without actually adding any page to the database. Is there any way to add a page in WordPress that way?
For now I'm using https://example.com/?facebook-webhook
and checking for isset( $_GET['facebook-webhook'] )
in the init
action. I would love to have it without the ?
though.
You can do this using a rewrite and query vars to use your custom php file as a template: