From c61a949bdb47abd9cc9bac1fb624bbec61d6b338 Mon Sep 17 00:00:00 2001 From: dingo-d Date: Sun, 29 Oct 2017 10:16:39 +0100 Subject: [PATCH] Change rest routes to prevent possible conflict --- inc/routes.php | 4 ++-- js/admin.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/routes.php b/inc/routes.php index 65bf9f2..b2c9eff 100644 --- a/inc/routes.php +++ b/inc/routes.php @@ -13,12 +13,12 @@ * @since 0.1.0 */ function theme_sniffer_endpoint_init() { - register_rest_route( 'wp/v2/theme-sniffer/', '/sniff-run', array( + register_rest_route( 'theme-sniffer/v1', '/sniff-run', array( 'methods' => 'POST', 'callback' => 'theme_sniffer_run_sniffer', ) ); - register_rest_route( 'wp/v2/theme-sniffer/', '/individual-sniff', array( + register_rest_route( 'theme-sniffer/v1', '/individual-sniff', array( 'methods' => 'POST', 'callback' => 'theme_sniffer_individual_sniff', ) ); diff --git a/js/admin.js b/js/admin.js index 4938e84..a1be282 100644 --- a/js/admin.js +++ b/js/admin.js @@ -42,7 +42,7 @@ jQuery( document ).ready(function($) { $.ajax({ type: 'POST', - url: '/wp-json/wp/v2/theme-sniffer/sniff-run', + url: '/wp-json/theme-sniffer/v1/sniff-run', data: data, beforeSend: function(xhr) { xhr.setRequestHeader( 'X-WP-Nonce', data.theme_sniffer_nonce ); @@ -85,7 +85,7 @@ jQuery( document ).ready(function($) { $.ajax({ type: 'POST', - url: '/wp-json/wp/v2/theme-sniffer/individual-sniff', + url: '/wp-json/theme-sniffer/v1/individual-sniff', data: data, beforeSend: function(xhr) { var $checkNotice = $('.check-done');