Home Forums Front-end Issues Display field data based on logged in user


Display field data based on logged in user

  • I have a repeater field, wherein the other admins can select a user and then enter a link that is specifically for that user.

    Any advice on how I can then display that link on the frontend, but only to that specific logged in user? Is it even possible to do so?

    if (is_user_logged_in()) {
      if (have_rows('repeater-field-name')) {
        $user_id = get_current_user_id();
        while (have_rows('repeater-field-name')) {
          if (get_sub_field('user_id') != $user_id) {
            // skip
          } // end if not for current user
          // display row content here
        } // end while have rows
      } // end if have rows
    } // end if user logged in
  • How can I see the code of an image?

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.