WordPress/wp-includes/rest-api
Adam Silverstein ea399e28a9 Revisions: return existing autosave after saving with unchanged data.
Correctly return the existing autosave when an unchanged autosave is saved, instead of returning an error.

Fix regressions after r55154 where an error and not the original autosave was returned when saving with unchanged data (for example, clicking the preview button repeatedly). Returning the autosave (ID) is the expected behavior for the endpoint.

Follow up to [55154]

Props Mamaduka, jeroenrotty, mrfoxtalbot.
Fixes #58739.


Built from https://develop.svn.wordpress.org/trunk@56163


git-svn-id: http://core.svn.wordpress.org/trunk@55675 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-07-07 17:53:23 +00:00
..
endpoints Revisions: return existing autosave after saving with unchanged data. 2023-07-07 17:53:23 +00:00
fields REST API: Check post meta update authorization only when value is changed. 2023-06-27 17:26:27 +00:00
search Docs: Miscellaneous improvements and corrections to docblocks. 2023-02-07 21:21:18 +00:00
class-wp-rest-request.php Code Modernization: Replace usage of strpos() with str_contains(). 2023-06-22 14:36:26 +00:00
class-wp-rest-response.php Coding Standards: Always use parentheses when instantiating an object. 2022-11-29 15:51:14 +00:00
class-wp-rest-server.php REST API: Correct some filter docblocks. 2023-07-06 23:23:22 +00:00