fix(auth): use restUrl for modal-login under plain permalinks
Local WP has empty permalink_structure so /wp-json/* 404s on Apache. modal-auth fell back to /wp-json/aksrt/v1; prefer aksrtData.restUrl (index.php?rest_route=/aksrt/v1) and join paths correctly.
This commit is contained in:
1 parent
d3cae1f1cb
commit
7daaa03417
3 files changed
+57
-4
No files matched your search
+5
-1
@@ -9,7 +9,11 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var API_ROOT = (window.aksrtData && window.aksrtData.apiUrl) || '/wp-json/aksrt/v1';
|
||||
var API_ROOT = (function () {
|
||||
var d = window.aksrtData || {};
|
||||
var raw = d.apiUrl || d.restUrl || d.rest_url || '/index.php?rest_route=/aksrt/v1';
|
||||
return String(raw).replace(/\/$/, '');
|
||||
})();
|
||||
var NONCE = (window.aksrtData && window.aksrtData.restNonce) || '';
|
||||
|
||||
function getReportCategories() {
|
||||
|
||||
Reference in new issue
Block a user