This commit is contained in:
Mykyta Synelnikov
2023-08-15 04:07:26 +03:00
parent bfef1f9dc7
commit 427437ff69
+21 -24
View File
@@ -1544,38 +1544,35 @@ if ( ! class_exists( 'um\core\Fields' ) ) {
return __( 'Custom Field', 'ultimate-member' );
}
/**
* Get form fields
*
* @return array
*/
function get_fields() {
/**
* UM hook
*
* @type filter
* @title um_get_form_fields
* @description Extend form fields
* @input_vars
* [{"var":"$fields","type":"array","desc":"Selected filter value"}]
* @change_log
* ["Since: 2.0"]
* @usage add_filter( 'um_get_form_fields', 'function_name', 10, 1 );
* @example
* <?php
* add_filter( 'um_get_form_fields', 'my_form_fields', 10, 1 );
* function my_form_fields( $fields ) {
* // your code here
* return $fields;
* }
* ?>
*/
$this->fields = apply_filters( 'um_get_form_fields', array() );
public function get_fields() {
if ( empty( $this->fields ) ) {
/**
* Filters the form fields.
*
* @param {array} $fields Form fields.
*
* @return {array} Form fields.
*
* @since 1.3.x
* @hook um_get_form_fields
*
* @example <caption>Extend form fields.</caption>
* function my_form_fields( $fields ) {
* // your code here
* return $fields;
* }
* add_filter( 'um_get_form_fields', 'my_form_fields' );
*/
$this->fields = apply_filters( 'um_get_form_fields', $this->fields );
}
return $this->fields;
}
/**
* Get specific field
*