Collapse Advanced Custom Fields Repeater by default
How to make ACF repeater fields more readable? This function will collapse repeater fields by default:
<?php /** * Collapse ACF Repeater by default */ add_action('acf/input/admin_head', 'wpster_acf_repeater_collapse'); function wpster_acf_repeater_collapse() { ?> <style id="wpster-acf-repeater-collapse">.acf-repeater .acf-table {display:none;}</style> <script type="text/javascript"> jQuery(function($) { $('.acf-repeater .acf-row').addClass('-collapsed'); $('#wpster-acf-repeater-collapse').detach(); }); </script> <?php }
Great code ! Working like a charm !
One more question : how authorize only One Tab Open ?
Thanks a lot
Great stuff, got sick of scrolling all the time!