Skip to content

Commit

Permalink
Merge pull request #78 from dingo-d/feature/separate-ajax-files
Browse files Browse the repository at this point in the history
Change rest routes to prevent possible conflict
  • Loading branch information
ernilambar authored Oct 30, 2017
2 parents 8cbfb32 + c61a949 commit 89c57e1
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 89c57e1

Please sign in to comment.