Skip to content

Instantly share code, notes, and snippets.

@yuriinalivaiko
Created November 4, 2022 12:06
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/8f133c172813984a9f12c4d693d97ab9 to your computer and use it in GitHub Desktop.
Save yuriinalivaiko/8f133c172813984a9f12c4d693d97ab9 to your computer and use it in GitHub Desktop.
Hook um_get_form_fields
<?php
/**
* Hook: um_get_form_fields
*
* Type: filter
*
* Description: Extend form fields.
* Used in the core to prepare form fields.
*
* @example https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/class-fields.php#L1524
* @link https://docs.ultimatemember.com/article/1143-umgetformfields
*
* @package um\core
* @see um\core\Fields::get_fields()
* @see um_get_form_fields()
* @since 2.0
* @version 3.0
*
* @param array $fields Form fields.
*
* @return array|string An array of fields or empty string if the form is not set.
*/
function my_get_form_fields( $fields ) {
// your code here.
return $fields;
}
add_filter( 'um_get_form_fields', 'my_get_form_fields', 100, 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment