-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
withAPIData URL parameters and Plain Permalinks #3215
Comments
the same problem with Is this the correct call? But force=true is not the correct call to delete a post to trash |
@RickorDD The force problem is a core wp-api.js bug: https://core.trac.wordpress.org/ticket/40672#comment:19 |
I expect the solution is to URL encode the REST path if it is appended to the root as a query argument? Arguably might be the responsibility of the core |
Core ticket: https://core.trac.wordpress.org/ticket/42382 |
Taking a look at this... |
It would be nice if Gutenberg could perform a common sense check in gutenberg_pre_init() to see if plain permalinks are being used and WordPress < 5..., or whichever version has the fix for TRAC 42382. |
@aduth Could we shim this in Gutenberg for the time being? |
Probably. We could either replace the apiRequest.buildAjaxOptions = flow( [
( options ) => {
// Fix `options.path` ...
},
apiRequest.buildAjaxOptions,
] ); |
Fix at #4877 |
Issue Overview
If you use plain permalinks and the withAPIData URL has parameters, the request fails because of two question marks.
Example:
/index.php?rest_route=/wp/v2/users?context=edit&per_page=100 Failed to load resource: the server responded with a status of 404 (Not Found)
Steps to Reproduce (for bugs)
Related Issues and/or PRs
#3121 Delete post fails with plain permalinks and force=true
Todos
The text was updated successfully, but these errors were encountered: