Skip to content

Commit

Permalink
Navigation Editor: use 'ajaxurl' global in batchSave action (#31028)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored Apr 26, 2021
1 parent 2fd57e9 commit 194b234
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/edit-navigation/src/store/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import {
computeCustomizedAttribute,
} from './utils';

const { ajaxurl } = window;

/**
* Creates a menu item for every block that doesn't have an associated menuItem.
* Requests POST /wp/v2/menu-items once for every menu item created.
Expand Down Expand Up @@ -184,7 +186,7 @@ function* batchSave( menuId, menuItemsByClientId, navigationBlock ) {
);

return yield apiFetch( {
url: '/wp-admin/admin-ajax.php',
url: ajaxurl || '/wp-admin/admin-ajax.php',
method: 'POST',
body,
} );
Expand Down

0 comments on commit 194b234

Please sign in to comment.