Support

Account

Home Forums Backend Issues (wp-admin) Display acf for currently logged in user inside wp-admin

Solved

Display acf for currently logged in user inside wp-admin

  • I’m trying to display a message on the admin page for the currently logged in user. I’m using the admin_notices hook to display a custom field assigned to all users, but it doesn’t appear.

    This is what I’m trying to do:
    <?php the_field(‘field-name’, get_current_user_id()); ?>

  • Solved! Just add ‘user_’ . before get_current_user_id():
    <?php the_field(‘field-name’, ‘user_’ . get_current_user_id()); ?>

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Display acf for currently logged in user inside wp-admin’ is closed to new replies.