Home › Forums › ACF PRO › Admin Area: Repeater Pagination › Reply To: Admin Area: Repeater Pagination
UPDATE:
I managed to implement a very crude version of what I want to achieve, in case someone else needs it or wants to expand on it.
I hardcoded the file advanced-custom-fields-pro/pro/fields/repeater.php, adding something like
if($i < $lmin) continue;
if($i > $lmax) continue;
around line ~300, in the foreach( $field[‘value’] as $i => $row ) loop.
$lmin and $lmax are URL parameters.
Below the repeater listing I added “pagination” links
<a href="URL[+]&lmin=0&lmax=50>See results 0-50</a>
<a href="URL[+]&lmin=51&lmax=100>See results 51-100</a>
...
I’ll keep looking into ACF’s beautifully written code to see if I can do this more elegantly, maybe without a page refresh.
The bad thing is that these edits will be overwritten if the plugin is upgraded, so if someone can suggest a way to do this without meddling with the plugin code, that would be great.
Some kind of hook like pre_get_posts for $field[‘value’] would be really useful.
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!
Accordions are a great way to group related information while allowing users to interactively show and hide content. In this video, Damon Cook goes in-depth on how to create an accessible accordion block using ACF PRO’s Repeater field.https://t.co/RXT0g25akN
— Advanced Custom Fields (@wp_acf) March 2, 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.