Skip to content

Instantly share code, notes, and snippets.

@yuriinalivaiko
Created November 4, 2022 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuriinalivaiko/4ebcac8e627cd0346345f109f5cab24b to your computer and use it in GitHub Desktop.
Save yuriinalivaiko/4ebcac8e627cd0346345f109f5cab24b to your computer and use it in GitHub Desktop.
Hook um_get_custom_field_array
<?php
/**
* Hook: um_get_custom_field_array
*
* Type: filter
*
* Description: Extend custom field data on submit form error.
* Used in the core to validate fields with conditional logic.
*
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/um-actions-form.php#L517
* @link https://docs.ultimatemember.com/article/1140-umgetcustomfieldarray
*
* @package um\core
* @see um_submit_form_errors_hook_()
* @see um_get_custom_field_array()
* @since 2.0
* @version 3.0
*
* @param array $field Field data.
* @param array $fields All fields.
*
* @return array Field data.
*/
function my_get_custom_field_array( $field, $fields ) {
// your code here.
return $field;
}
add_filter( 'um_get_custom_field_array', 'my_get_custom_field_array', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment