diff --git a/acf-country.php b/acf-country.php index 524c39f..f64aa7b 100644 --- a/acf-country.php +++ b/acf-country.php @@ -3,7 +3,7 @@ Plugin Name: Advanced Custom Fields: ACF Country Plugin URI: https://github.com/nlemoine/acf-country Description: Display a select field of all countries, in any language. -Version: 2.1.0 +Version: 2.1.1 Author: Nicolas Lemoine Author URI: https://helloni.co/ GitHub Plugin URI: https://github.com/nlemoine/acf-country @@ -32,7 +32,7 @@ class FieldLoader { */ public function __construct() { $this->settings = array( - 'version' => '2.0.2', + 'version' => '2.1.1', 'url' => plugin_dir_url( __FILE__ ), 'path' => plugin_dir_path( __FILE__ ), ); @@ -159,7 +159,9 @@ public function add_graphql_field_support( $supported_fields ) { * @return void */ public function fields( $version = 5 ) { - include_once 'fields/acf-country.php'; + require_once 'fields/acf-country.php'; + $field = new AcfCountry( $this->settings ); + acf_register_field_type( $field ); } } diff --git a/fields/acf-country.php b/fields/acf-country.php index d903500..3b49242 100644 --- a/fields/acf-country.php +++ b/fields/acf-country.php @@ -6,12 +6,10 @@ return; } -use acf_field; - /** * ACF Country field */ -class AcfCountry extends acf_field { +class AcfCountry extends \acf_field { /** * Constructor @@ -277,5 +275,3 @@ private function get_countries() { return apply_filters( 'acf/country/countries', $countries ); } } - -new AcfCountry( $this->settings );