Skip to content

Instantly share code, notes, and snippets.

@trex005
Created October 5, 2016 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save trex005/409f1fd873b9487a040ec79b6440a0cf to your computer and use it in GitHub Desktop.
Save trex005/409f1fd873b9487a040ec79b6440a0cf to your computer and use it in GitHub Desktop.
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