Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working preserve order #18

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
Update acf-country-helpers.php
Added default preserver_order settings
  • Loading branch information
juslintek authored Jun 12, 2018
commit c79b330b06b9a44cc05f7be2d2a288469dc64840
2 changes: 2 additions & 0 deletions fields/acf-country-helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public static function get_defaults() {
'default_value' => '',
'ui' => 1,
'return_format' => 'array',
'preserve_order' => 0,
'placeholder' => __('Select a country', 'acf-country'),
);
}
Expand Down Expand Up @@ -43,6 +44,7 @@ public static function render_field( $field ) {
'data-multiple' => $field['multiple'],
'data-placeholder' => $field['placeholder'],
'data-allow-null' => $field['allow_null'] ? 1 : 0,
'data-preserve-order' => $field['preserve_order'] ? 1 : 0,
);

$attrs['class'] .= ' acf-country';
Expand Down