doc- を追加したい変数があるので、ワードプレスの高度なカスタム フィールドに対してこのように doc-$user_role を読み取ります。
私はエコーでこれを行う方法を知っていますが、この形式では難しいと感じています:)
<?php
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
if(get_field('doc-$user_role')): ?>
<ul>
<?php while(has_sub_field('doc-$user_role')): ?>
<li>
<h3><?php the_sub_field('doc_name'); ?></h3>
<p><?php the_sub_field('doc_description'); ?></p>
<a href="<?php the_sub_field('download_doc'); ?>" target="_blank"><img src="<?php bloginfo('template_directory'); ?>/images/download.png" alt="download_button"></a>
</li>
<?php endwhile; ?>
</ul>
<?php endif; ?>