wenprise/wordpress-dispatcher

Create URL endpoints within WordPress

2.1 2020-01-14 06:51 UTC

This package is auto-updated.

Last update: 2024-04-23 14:54:18 UTC


README

Easily add custom URL endpoints in WordPress. Map a url to a function.

##Example

use \Wenprise\Dispatcher\Router;

Router::routes([

    'testing-a-url' => function(){
        echo 'Hello Ted';
    },

    'hello-([a-z]+)' => function($request, $name){
        echo "Hello $name";
    }
]);

/testing-a-url & /hello-dougle will now be accessable in your WordPress site.

##Install

###Composer

composer require wenprise/wordpress-dispatcher