CodeSpud

Create WordPress Endpoints

January 13, 2016

I was building a wordpress plugin for use with Rand Group’s website and other clients. One of the features of this plugin is to provide a slug for displaying resources built from Download Monitor( shown below )

`
/[content-type]/[download-slug]

e.g.

/brochure/7-mistakes-in-software-integration

// this should be interpreted by wordpress like

/?brochure=7-mistakes-in-software-integration
`

WordPress provides functions to do this pretty easily. I list this steps below

  1. Identify your endpoints
  2. Add your endpoint
  3. Register a function to add query variables
  4. Provide a handler
By @codespud  
DISCLAIMER This is my personal weblog and learning tool. The content within it is exactly that – personal. The views and opinions expressed on the posts and the comments I make on this Blog represent my own and not those of people, institutions or organisations I am affiliated with unless stated explicitly. My Blog is not affiliated with, neither does it represent the views, position or attitudes of my employer, their clients, or any of their affiliated companies.