conditional-logic.php
1 year ago
field.php
2 months ago
fields.php
2 months ago
index.php
1 year ago
list-empty.php
8 months ago
location-group.php
1 year ago
location-rule.php
8 months ago
locations.php
8 months ago
options.php
8 months ago
locations.php
51 lines
| 1 | <?php |
| 2 | |
| 3 | // global |
| 4 | global $field_group; |
| 5 | ?> |
| 6 | <div class="acf-field"> |
| 7 | <div class="acf-label"> |
| 8 | <label><?php esc_html_e( 'Rules', 'secure-custom-fields' ); ?></label> |
| 9 | <i tabindex="0" class="acf-icon acf-icon-help acf-js-tooltip" title="<?php esc_attr_e( 'Create a set of rules to determine which edit screens will use these custom fields', 'secure-custom-fields' ); ?>">?</i> |
| 10 | </div> |
| 11 | <div class="acf-input"> |
| 12 | <div class="rule-groups"> |
| 13 | |
| 14 | <?php |
| 15 | foreach ( $field_group['location'] as $i => $group ) : |
| 16 | |
| 17 | // bail early if no group |
| 18 | if ( empty( $group ) ) { |
| 19 | return; |
| 20 | } |
| 21 | |
| 22 | |
| 23 | // view |
| 24 | acf_get_view( |
| 25 | 'acf-field-group/location-group', |
| 26 | array( |
| 27 | 'group' => $group, |
| 28 | 'group_id' => "group_{$i}", |
| 29 | ) |
| 30 | ); |
| 31 | endforeach; |
| 32 | ?> |
| 33 | |
| 34 | <h4><?php esc_html_e( 'or', 'secure-custom-fields' ); ?></h4> |
| 35 | |
| 36 | <a href="#" class="button add-location-group"><?php esc_html_e( 'Add rule group', 'secure-custom-fields' ); ?></a> |
| 37 | |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <script type="text/javascript"> |
| 42 | if( typeof acf !== 'undefined' ) { |
| 43 | |
| 44 | acf.newPostbox({ |
| 45 | 'id': 'acf-field-group-locations', |
| 46 | 'label': 'left' |
| 47 | }); |
| 48 | |
| 49 | } |
| 50 | </script> |
| 51 |