Skip to content

fix chapter metabox admin issue #421

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

Merged
merged 1 commit into from
Aug 31, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix chapter metabox admin issue
  • Loading branch information
hugosolar committed Aug 31, 2020
commit 6f674311397d1d84ba889e135d5d2a67ea9eb486
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public function __construct($id = '', $title = '', $post_type = '', array $args
public function get_countries() {
$search = filter_input(INPUT_GET, 'q', FILTER_SANITIZE_STRING);
$country_id = (array)get_post_meta(get_the_ID(), 'cc_chapter_chapter_country', false);
$countries = $countries = GF_Field_Address::get_countries();
$field_address = new GF_Field_Address();
$countries = $field_address->get_countries();
$results = [];
foreach ($countries as $key=>$country) {
if (!empty($search)) {
Expand Down Expand Up @@ -131,18 +132,12 @@ public function get_fields() : array
'width' => '100%',
'multiple' => false,
'minimumInputLength' => 3
// 'ajax' => [
// 'url' => admin_url('admin-ajax.php?action=event-metabox__get_countries'),
// ]
],
'description' => 'Choose the Chapter Country',
],
'options' => (function () {
// $country_id = (array)get_post_meta(get_the_ID(), 'cc_chapter_chapter_country', false);
// if (!$country_id) {
// return [];
// }
$countries = GF_Field_Address::get_countries();
$field_address = new GF_Field_Address();
$countries = $field_address->get_countries();
if (!empty($countries)) {
return $countries;
}
Expand Down