WordPress plugin page routing

I’m currently working on a WordPress plugin and I need it to stick some pages into the front end. Now what I could do is create the pages manually and then create templates which call to the plugin functions, but this would then mean the plugin is managed in two places.

The pages I need are:

Read More
  • a calendar page
  • a booking page
  • a return page (from PayPal)
  • a cancel page (from PayPal)

It would be preferred if the plugin could just add these pages automatically rather than having to create them as actual posts or pages in the db, as otherwise the site owners may mess them up. Plus it keeps them contained within the plugin directory.

I assume I’m looking for some form of listener so that when a particular URL is hit, it goes to the plugin, rather than trying to load a normal page from the wordpress db.

Can anyone give any insight into how I achieve this?

Related posts

Leave a Reply

2 comments