UPME Actions for Developers
Documentation for using UPME Actions for customizing existing behaviour and adding new behaviour.
Documentation for UPME Actions
– upme_validate_login
– Useful for validating the user based on custom conditions before allwoing login.
– User credentials
function upme_validate_login($creds){ global $upme_login; // Execute custom validations based on any type of conditions // Assign the validation errors into $upme_login->errors[] variable if('admin' != $creds['user_login']){ $upme_login->errors[] = 'Custom Error Message 1; $upme_login->errors[] = 'Custom Error Message 2; } } add_action('upme_validate_login','upme_validate_login');
– upme_validate_username
– Validate username based on custom conditions before creating a new user.
– Username
function upme_validate_username($username){ global $upme_register; // Execute any kind of custom validation on usernames and assign the errors into $upme_register->errors[] variable if($username == 'admin'){ $upme_register->errors[] = 'Custom Validation for Username Failed'; } } add_action('upme_validate_username','upme_validate_username');
– upme_after_password_change
– Execute custom functionality after changing the password. Useful for sending password change email.
– User ID
function upme_after_password_change($user_id){ // Execute any task after password change. // Usefull for retriving user data using the user ID and sending password change email } add_action('upme_after_password_change','upme_after_password_change');
– upme_before_delete_field
– Execute custom functionality before deleting a custom field. Useful for validating field delete process.
– Data for deleted field
function upme_before_delete_field($field){ global $upme_admin; // Use the various attibute values of the field for validation. Use print_r on $field to list all attributes // Assign the error messages into $upme_admin->delete_error variable. if($field['meta'] == 'password'){ $upme_admin->delete_error = 'This field is not allowed to be deleted.'; } } add_action('upme_before_delete_field','upme_before_delete_field');
– upme_after_delete_field
– Execute custom functionality after deleting a custom field. Useful for clearing database data after delete process.
– Data for deleted field
function upme_after_delete_field($field){ // Delete user meta from the table using custom WordPress query } add_action('upme_after_delete_field','upme_after_delete_field');