Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('ABSPATH') or die("Fuck accessing!");
- /**
- * Create route for access to api url
- */
- function create_routes(WP_Router $route){
- $router->add_route('manage-api-routes', array(
- 'path' => '^api$',
- 'access_callback' => true,
- 'page_callback' => function(){
- echo "Tes route api";
- },
- 'template' => false
- ));
- }
- add_action( 'wp_router_generate_routes', 'create_routes' );
- /**
- * Manage subpath route access to api
- */
- function manage_api_routes(){
- echo "tes route api";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement