Support » Plugin: Ultimate Member - User Profile & Membership Plugin » How can we make use of Field Groups for custom fields?

  • I’m writing some hooks to add some custom fields to the account page form. There are some fields I’d like to put into groups. But it’s not documented and the code itself isn’t super helpful.

    I have a “group” field setup like this:

    $um_fields[ 'favorites' ] = array(
                        'type' => 'group',
                        'metakey' => 'favorites',
                        'label' => 'favorites',
                        'title' => 'favorites',
                    );

    Then I have a loop iterating over an array to add some fields to this group.

    $um_fields[ 'subfield_name' ] = array(
                            'title' => 'subfield_name',
                            'metakey' => 'favorites_subfield_name',
                            'type' => 'text',
                            'label' => 'label',
                            'in_group' => 'favorites',
                        );

    But anytime I assign an “in_group” key in this array, the field does not show up. And I get an error: Warning: Invalid argument supplied for foreach() in /wp-content/plugins/ultimate-member/includes/core/class-fields.php on line 3340

  • The topic ‘How can we make use of Field Groups for custom fields?’ is closed to new replies.