ims_save_user_errors

Description

The “ims_save_user_errors” filter is used to add error when a user (customer) is saved using the customer menu in the admin area.

A plugin (or theme) can modify the output with the code:

<?php add_filter( 'ims_save_user_errors', 'filter_function_name'); ?>

The hook is located in the image-store/_inc/customers.php file.

Example

// Apply filter
function modify_ims_save_user_errors( $errors, $post_data, $user ) {
	$errors->add( 'my-custom-error', __('error message') );
	return  $errors;
}
add_filter('ims_save_user_errors', 'modify_ims_save_user_errors');

Note:  $errors is an WordPress error object$post_data is an associative array, $user is an object returned by get_user_by().


Leave a Reply

Your email address will not be published. Required fields are marked *