Skip to content

Instantly share code, notes, and snippets.

@yuriinalivaiko
Created November 4, 2022 11:54
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/805d6de17568b44dfdad0e5ff378a0ff to your computer and use it in GitHub Desktop.
Save yuriinalivaiko/805d6de17568b44dfdad0e5ff378a0ff to your computer and use it in GitHub Desktop.
Hook um_admin_pre_save_field_to_form
<?php
/**
* Hook: um_admin_pre_save_field_to_form
*
* Type: filter
*
* Description: Change field data before save to form.
*
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/admin/core/class-admin-builder.php#L725
* @link https://docs.ultimatemember.com/article/1000-umadminpresavefieldtoform
*
* @package um\admin\core
* @see um\admin\core\Admin_Builder::update_field()
* @since 2.0
* @version 3.0
*
* @param array $field_args Field data.
*
* @return array Field data.
*/
function my_admin_pre_save_field_to_form( $field_args ) {
// your code here.
return $field_args;
}
add_filter( 'um_admin_pre_save_field_to_form', 'my_admin_pre_save_field_to_form', 10, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment