Skip to content

Instantly share code, notes, and snippets.

@harrisoncparker
harrisoncparker / WP_Endpoint.php
Last active February 4, 2019 15:36
Very simple single class for creating custom endpoint in vanilla wordpress. Based on this stackoverflow answer: https://stackoverflow.com/questions/38901536/wordpress-map-custom-url-to-a-function Not intended to be a full solution.
<?php
/**
* @author Harrison Parker
* @github https://github.com/harrisoncparker
*/
class WP_Endpoint
{
private $route;
private $callable;