apply_filters( 'um_image_upload_validation', $custom_validation, $id, $user_id ) → {bool}
Filters the custom validation marker for 3rd-party uploader.
Parameters:
Name | Type | Description |
---|---|---|
$custom_validation |
bool | Custom validation marker. Is null by default. Keep null for UM core validation. |
$id |
string | Uploader field key. |
$user_id |
int | User ID. |
- Since:
- 2.9.1
- Source:
Returns:
Custom validation marker.
- Type
- bool
Example
function my_um_image_upload_validation( $custom_validation, $id, $user_id ) {
// your code here
$ret['error'] = esc_html__( 'Error code', 'ultimate-member' );
wp_send_json_error( $ret );
return true;
}
add_filter( 'um_image_upload_validation', 'my_um_image_upload_validation', 10, 3 );