diff options
| author | Max | 2018-11-05 12:47:47 +0100 |
|---|---|---|
| committer | Max | 2018-11-05 12:47:47 +0100 |
| commit | 1373956529cd4c5f7a5bdfaefad407b24c8bb828 (patch) | |
| tree | 98f6cee101b6a77a723f5796291b8128af396180 /api/api.php | |
| parent | 89bcafe654844367ea3a730c8c03b8e63047db06 (diff) | |
| download | fuselkoenig_de-1373956529cd4c5f7a5bdfaefad407b24c8bb828.tar.gz | |
Adds first version of an API to get the top navigation menu and the sidebar.
Diffstat (limited to 'api/api.php')
| -rw-r--r-- | api/api.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/api/api.php b/api/api.php new file mode 100644 index 0000000..8332946 --- /dev/null +++ b/api/api.php @@ -0,0 +1,15 @@ +<?php + +require_once get_template_directory() . '/api/menu.php'; +require_once get_template_directory() . '/api/sidebar.php'; + +add_action( 'rest_api_init', function () { + register_rest_route( 'fuselkoenig', '/menu', array( + 'methods' => 'GET', + 'callback' => 'fk_get_menu', + ) ); + register_rest_route( 'fuselkoenig', '/sidebar', array( + 'methods' => 'GET', + 'callback' => 'fk_get_sidebar', + ) ); +} ); |
