Skip to content

Commit 6f67431

Browse files
committed
fix chapter metabox admin issue
1 parent 4c71d54 commit 6f67431

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

themes/cc-commoners-2019/inc/custom-post-type/queulat-cc-chapters-cpt-plugin/class-cc-chapters-metabox.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public function __construct($id = '', $title = '', $post_type = '', array $args
2222
public function get_countries() {
2323
$search = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
2424
$country_id = (array)get_post_meta(get_the_ID(), 'cc_chapter_chapter_country', false);
25-
$countries = $countries = GF_Field_Address::get_countries();
25+
$field_address = new GF_Field_Address();
26+
$countries = $field_address->get_countries();
2627
$results = [];
2728
foreach ($countries as $key=>$country) {
2829
if (!empty($search)) {
@@ -131,18 +132,12 @@ public function get_fields() : array
131132
'width' => '100%',
132133
'multiple' => false,
133134
'minimumInputLength' => 3
134-
// 'ajax' => [
135-
// 'url' => admin_url('admin-ajax.php?action=event-metabox__get_countries'),
136-
// ]
137135
],
138136
'description' => 'Choose the Chapter Country',
139137
],
140138
'options' => (function () {
141-
// $country_id = (array)get_post_meta(get_the_ID(), 'cc_chapter_chapter_country', false);
142-
// if (!$country_id) {
143-
// return [];
144-
// }
145-
$countries = GF_Field_Address::get_countries();
139+
$field_address = new GF_Field_Address();
140+
$countries = $field_address->get_countries();
146141
if (!empty($countries)) {
147142
return $countries;
148143
}

0 commit comments

Comments
 (0)