Home › Forums › Front-end Issues › No Documentation for Displaying User Data › Reply To: No Documentation for Displaying User Data
Here’s what I ended up doing, feedback is welcome though:
echo "<ul>";
$args = array(
'orderby' => 'asc',
'post_type' => 'recap',
);
$recaps = get_posts( $args );
$user_ID = get_current_user_id();
foreach ( $recaps as $recap ) : setup_postdata( $recap );
// Get the User selected as Customer.
$field_key = "field_546162f4a416d";
$post_id = $recap->ID;
$field = get_field_object($field_key, $post_id);
$values = $field['value'];
if ( in_array( 898, $values ) ) {
echo '<li><h3><a href="' . get_permalink($recap->ID) . '">' . $recap->post_title . '</a></h3></li>';
} else {
echo "<h4>You do not currently have any Recaps.</h4>";
}
endforeach;
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.