settings = array( 'version' => '1.0.0', 'url' => plugin_dir_url(__FILE__), 'path' => plugin_dir_path(__FILE__) ); // include field add_action('acf/include_field_types', array($this, 'include_field')); // v5 add_action('acf/register_fields', array($this, 'include_field')); // v4 } /* * include_field * * This function will include the field type class * * @type function * @date 17/02/2016 * @since 1.0.0 * * @param $version (int) major ACF version. Defaults to false * @return void */ function include_field($version = false) { // support empty $version if (!$version) $version = 5; // load acf-ionicon load_plugin_textdomain('acf-ionicon', false, plugin_basename(dirname(__FILE__)) . '/lang'); // include if ($version >= 5) { include_once('fields/class-jackardios-acf-field-ionicon-v' . $version . '.php'); } else { add_action('admin_notices', array($this, 'show_unsupported_version_notice')); } } /* * show_unsupported_version_notice * * Show 'Unsupported version of ACF' notice * * @return void */ function show_unsupported_version_notice() { ?>