Home Forums ACF PRO Admin Area: Repeater Pagination Reply To: Admin Area: Repeater Pagination


    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.