Leave a Reply

1 comment

  1. $thevoters_ids = get_post_meta( get_the_ID(), "thevoters", true ); // get a comma separated list of ids
    
    $thevoters_ids = explode( ',', $thevoters_ids ); // turn the list into an array
    
    foreach ( $thevoters_ids as $thevoter_id ) { // loop through the ids
        $thevoter = get_user_by( 'id', $thevoter_id ); // get the user object by id
        echo $thevoter->display_name; // display the user name
    }