src/User/UserField.php
public function display($user)
    {
        foreach ($this->repository->getGroups() as $group) {
            /** @var SectionInterface $group */
            $fields = $group->getItems();

            if (is_a($user, 'WP_User')) {
                // Initiate the value (edit screens only).
                array_walk($fields, function ($field) use ($user) {
                    /** @var CanHandleUsers $field */
                    $field->userGet($user->ID);
                });
            }

            echo $this->factory->make('themosis.users.main', [
                'section' => $group,
                'fields' => $fields
            ])->render();
        }
    }
public function display($user)
    {
        foreach ($this->repository->getGroups() as $group) {
            /** @var SectionInterface $group */
            $fields = $group->getItems();

            if (is_a($user, 'WP_User')) {
                // Initiate the value (edit screens only).
                array_walk($fields, function ($field) use ($user) {
                    /** @var CanHandleUsers $field */
                    $field->userGet($user->ID);
                });
            }

            echo $this->factory->make('themosis.users.main', [
                'section' => $group,
                'fields' => $fields
            ])->render();
        }
    }
public function display ( $ user ) { foreach ( $ this -> repository -> getGroups ( ) as $ group ) { /** @var SectionInterface $group */ $ fields = $ group -> getItems ( ) ; if ( is_a ( $ user , 'WP_User' ) ) { // Initiate the value (edit screens only). array_walk ( $ fields , function ( $ field ) use ( $ user ) { /** @var CanHandleUsers $field */ $ field -> userGet ( $ user -> ID ) ; } ) ; } echo $ this -> factory -> make ( 'themosis.users.main' , [ 'section' => $ group , 'fields' => $ fields ] ) -> render ( ) ; } }
Display user meta fields.

If adding a user, $user is a string and represent
a context: 'add-existing-user' (multisite),
'add-new-user' (single). Else is a WP_User instance.

@param mixed $user
Display user meta fields .