ldc-sbv/wp-content/plugins/advanced-custom-fields-pro/includes/admin/views/html-location-rule.php

98 lines
1.5 KiB
PHP
Raw Normal View History

2021-09-24 18:39:19 +02:00
<?php
// vars
$prefix = 'acf_field_group[location][' . $rule['group'] . '][' . $rule['id'] . ']';
?>
2021-09-21 15:01:08 +02:00
<tr data-id="<?php echo $rule['id']; ?>">
<td class="param">
2021-09-24 18:39:19 +02:00
<?php
2021-09-21 15:01:08 +02:00
// vars
$choices = acf_get_location_rule_types();
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
// array
2021-09-24 18:39:19 +02:00
if ( is_array( $choices ) ) {
acf_render_field(
array(
'type' => 'select',
'name' => 'param',
'prefix' => $prefix,
'value' => $rule['param'],
'choices' => $choices,
'class' => 'refresh-location-rule',
)
);
2021-09-21 15:01:08 +02:00
}
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
?>
</td>
<td class="operator">
2021-09-24 18:39:19 +02:00
<?php
2021-09-21 15:01:08 +02:00
// vars
$choices = acf_get_location_rule_operators( $rule );
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
// array
2021-09-24 18:39:19 +02:00
if ( is_array( $choices ) ) {
acf_render_field(
array(
'type' => 'select',
'name' => 'operator',
'prefix' => $prefix,
'value' => $rule['operator'],
'choices' => $choices,
)
);
// custom
2021-09-21 15:01:08 +02:00
} else {
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
echo $choices;
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
}
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
?>
</td>
<td class="value">
<?php
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
// vars
$choices = acf_get_location_rule_values( $rule );
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
// array
2021-09-24 18:39:19 +02:00
if ( is_array( $choices ) ) {
acf_render_field(
array(
'type' => 'select',
'name' => 'value',
'prefix' => $prefix,
'value' => $rule['value'],
'choices' => $choices,
)
);
// custom
2021-09-21 15:01:08 +02:00
} else {
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
echo $choices;
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
}
2021-09-24 18:39:19 +02:00
2021-09-21 15:01:08 +02:00
?>
</td>
<td class="add">
2021-09-24 18:39:19 +02:00
<a href="#" class="button add-location-rule"><?php _e( 'and', 'acf' ); ?></a>
2021-09-21 15:01:08 +02:00
</td>
<td class="remove">
<a href="#" class="acf-icon -minus remove-location-rule"></a>
</td>
2021-09-24 18:39:19 +02:00
</tr>