Enable sanitize_callback to return WP_Error
|Reported by:||websupporter||Owned by:||rachelbaker|
As discussed in Slack, it might be helpful, if the sanitization callback could return a WP_Error object like the validation callback.
This patch wants to get this done.
With this patch, we would give developers the opportunity to reject incoming data without using the validation callback. It also enables us to do sanitization and validation in one function in instances where this could be useful.
I've oriented the solution on how it is done in the validation callback:
So, first all Errors are collected and then they will be returned. So if a request has more than one error, you get all the messages at once.
Change History (8)
8 months ago
- Milestone changed from Awaiting Review to 4.7
- Owner set to rachelbaker
- Status changed from new to assigned