Reply To: Displaying a list of users and their submitted data

Home Forums User Registration Displaying a list of users and their submitted data Reply To: Displaying a list of users and their submitted data

#19237

Mike Berg
Participant

This is the error that’s showing on the page:

Warning: Invalid argument supplied for foreach() in <file path and line number>

Here’s the full code:

<?php
    $args = array(
	    'role'         => 'volunteer_applicant_2019',
	    'orderby'      => 'nicename',
    );
    $blogusers = get_users( $args );
    foreach ($blogusers as $user) { 
?>
    

	 <tr>
	    <td>
		    <a href="mailto:<?php echo $user->user_email; ?>"><?php echo $user->first_name ?>
	    </td>
	    <td>
		    <a href="https://homesteaderfest.ca/wp-admin/user-edit.php?user_id=<?php echo $user->ID; ?>" target="_blank"><?php echo $user->last_name ?></a>
	    </td>
	    <td class="phone">
		    <?php 
			    $phone = get_user_meta( $user->ID, 'user_registration_phone_1548907243', true );
			    echo $phone; 
			?>
	    </td>
	   
	    <td class="coord_vol">
			<?php 
			    $coord = get_user_meta( $user->ID, 'user_registration_radio_1549031297', true );
			    echo $coord; 
			?>
	    </td>
	    <td class="shift">
			<?php 
			    $shiftchoices = get_user_meta( $user->ID, 'user_registration_check_box_1548908196', true );
			    foreach($shiftchoices as $shiftchoice){
				    echo $shiftchoice;
				    echo '<br />'; 
			    }
			?>
	    </td>
	    <td class="first_choice">
		    <?php 
			    $coord = get_user_meta( $user->ID, 'user_registration_select_1548908371', true );
			    echo $coord; 
			?>
	    </td>
	    <td class="second_choice">
		    <?php 
			    $coord = get_user_meta( $user->ID, 'user_registration_select_1548908498760', true );
			    echo $coord; 
			?>
	    </td>
	    <td class="third_choice">
		    <?php 
			    $coord = get_user_meta( $user->ID, 'user_registration_select_1548908551352', true );
			    echo $coord; 
			?>
	    </td>
    </tr>
    
<?php } ?>