Skip to content

Commit

Permalink
Change rest routes to prevent possible conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
dingo-d committed Oct 29, 2017
1 parent d2b4cc4 commit c61a949
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions inc/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
) );
Expand Down
4 changes: 2 additions & 2 deletions js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit c61a949

Please sign in to comment.