Home › Forums › Bug Reports › Repeater on options page returns count › Reply To: Repeater on options page returns count
Hi @ccernoch
Thanks for the code. The issue here is that you are using the get_field
function in the root of the functions.php file.
The repeater field add-on is currently included during the init
action. This action is run AFTER the functions.php file is read, so the issue you are seeing is that the repeater field is not yet loaded and can’t run it’s custom load_value logic.
To solve the issue, please hook into the init action and run your get_field
code there.
add_action('init', function(){
$hidden_users = get_field('hide-users', 'options');
var_dump($hidden_users);
});
Thanks
E
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!
🤔 Curious about the ACF user experience? So are we! Help guide the evolution of ACF by taking part in our first ever Annual Survey and guarantee you’re represented in the results. https://t.co/0cgr9ZFOJ5
— Advanced Custom Fields (@wp_acf) May 8, 2023
© 2023 Advanced Custom Fields.
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.