Created
October 5, 2016 06:28
-
-
Save trex005/409f1fd873b9487a040ec79b6440a0cf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
86a87 | |
> 'add' => '0', | |
198a200 | |
> $layouts[ $layout['name'] ]['found'] = 0; | |
238c240 | |
< | |
--- | |
> $layouts[ $value['acf_fc_layout'] ]['found']++; | |
243a246,261 | |
> <?php | |
> foreach($layouts as $layout){ | |
> if( | |
> !isset($layout['add']) || | |
> !$layout['add'] || | |
> !isset($layout['min']) || | |
> !$layout['min'] || | |
> $layout['min'] <= $layout['found'] | |
> )continue; | |
> while($layout['found'] < $layout['min']){ | |
> $layout['found']++; | |
> $i++; | |
> $this->render_layout( $field, $layout, $i, array() ); | |
> } | |
> } | |
> ?> | |
245d262 | |
< | |
594a612,630 | |
> <li class="acf-fc-meta-add"> | |
> <div class="acf-input-prepend"><?php _e('Auto Add Required Rows','acf'); ?></div> | |
> <div class="acf-radio-list"> | |
> <?php | |
> | |
> acf_render_field(array( | |
> 'type' => 'radio', | |
> 'name' => 'add', | |
> 'choices' => array( | |
> 1 => __("Yes",'acf'), | |
> 0 => __("No",'acf'), | |
> ), | |
> 'prefix' => $layout_prefix, | |
> 'value' => $layout['add'], | |
> 'layout' => 'horizontal', | |
> )); | |
> ?> | |
> </div> | |
> </li> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment