Home Forums General Issues Showdown content if current user.. Reply To: Showdown content if current user..

  • Hi VoiD2008, thank you for your reply.

    Unfortunately it doesn’t work, and my php knowledge is not good enough to fix it.
    I should insert a control to check if the array exists or not I think..

    If I use this code, that works only with one username in that field,

    global $current_user;
    if ($current_user->user_login == 'get_field(mustjoin)') { ?>
    	<?php while ($day['events']->have_posts()) : $day['events']->the_post() ?>
    <?php tribe_get_template_part('month/single', 'event') ?>
    <?php endwhile; ?>
    		<?php } ?>

    Everything works.

    Of course, with two usernames in the field, it doesn’t. But I don’t receive an error.. it just works as it should, because it checks for an username made by the 1st+2nd usernames together.
    With a
    var_dump( get_field('mustjoin') ); I receive this :
    string(17) "User1 User2 User3"

    Thank you for your help.