Boom thanks @vverner!
it ended up being:
$user_id = $user->ID;
not
$user_id = $user->user_id
But yours got me there! Thanks!
Hey, @vverner, thanks for the reply! I added your code (not sure if it’s in the right place though ) but nothing happened. The code below still just outputs the display_name but not the org_name field.
Is it in the wrong place? What else am I doing wrong?
<?php
$args = array(
'role' => 'organization',
'orderby' => 'login',
'order' => 'ASC',
);
$org_users = get_users( $args );
foreach ($org_users as $user) {
$user_id = get_current_user_id();
get_field("org_name","user_".$user_id);
echo '<div class="resource-item">';
echo '<p>';
echo esc_html( $user->display_name );
echo the_field("org_name","user_".$user_id);
echo '<br>';
echo '</p>';
echo '</div>';
}
?>
Now that I have purchased ACF Pro and have been playing around with it, I have confirmed that this is indeed the default behavior of ACF User Meta, it gets added to the default registration form. This rocks. I’ll mark this as resolved
Perfect @hube2 that lets me know what I need!
Thanks, @hube2,
in regards to your answer to #1, does it load the JS site-wide (aka on every page) or on just the page where the acf_form() is added?
I have looked into other form software and some like Toolset Forms loads JS across the whole site, while others like Gravity Forms only loads the JS on the pages where a form is added.
If its like Gravity Forms, I can still use acf_form() and just set those specific pages to not use AMP. If it loads site-wide, however, I can’t use it as I want the majority of the website to validate as AMP.
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.