Display selected user in profile
-
What can I do to allow a registered user with the role 'Fighter’ to select a club, i.e. users from a list with the role 'club’. After the fighter selects the club, the user is displayed in the club profile. I am using the Ultimate Member Role and I already have such code but it does not work as it should. someone can help me? 😀
/**
*lista
*/
function populate_club_field()
{
$args = array(
'role' => 'um_club',
'orderby' => 'user_nicename',
'order' => 'ASC'
);
$users = get_users( $args );
$clubs = array();
foreach ( $users as $user ) {
$clubs[] = $user->club_name;
}
return $clubs;
}
function populate_fighters_field()
{
$args = array(
'role' => 'um_fighter',
'orderby' => 'user_nicename',
'order' => 'ASC'
);
$users = get_users( $args );
$clubs = array();
foreach ( $users as $user ) {
$clubs[] = $user->imie_nazwisko;
}
return $clubs;
}
Strona przy której potrzebuję pomocy: [zaloguj się aby zobaczyć ten link]
Temat ‘Display selected user in profile’ jest zamknięty na nowe odpowiedzi.