Commit 6f80ba2
committed
Add error handling for edit/ajax requests where a required parameter is missing
If we're performing an edit action via ajax, and one of the required parameters is missing, we can provide a WP Error object with a message that contains the missing parameter. We then return the error message to the front end via die(), which kills the ajax request as well and allows for another attempt.1 parent 8ca1610 commit 6f80ba2
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
240 | 244 | | |
241 | 245 | | |
242 | 246 | | |
| |||
433 | 437 | | |
434 | 438 | | |
435 | 439 | | |
436 | | - | |
437 | | - | |
| 440 | + | |
438 | 441 | | |
439 | | - | |
| 442 | + | |
440 | 443 | | |
441 | 444 | | |
442 | 445 | | |
| |||
0 commit comments