Icon field won't work
Do I need to download and install https://github.com/htmlburger/carbon-field-icon to make it work? In version 2.1.0, this field is not working.
Hi @sachittandukar ,
Yes, the icon field is a separate add-on package that you need to install using composer: https://packagist.org/packages/htmlburger/carbon-field-icon
Thanks @atanas-angelov-dev
is posible install without composer?
Hi @dackr ,
You can use it without composer. Download the field from https://github.com/htmlburger/carbon-field-icon and include the PATH_TO_FIELD/core/Icon_Field.php and PATH_TO_FIELD/field.php files.
ok thanks for your help
I'm calling the files but I get this error.
Fatal error: Class 'Carbon_Fields\Field\Predefined_Options_Field' not found in /.../lib/carbon-field-icon/core/Icon_Field.php on line 7. Thanks for your help.
@dackr - Which is the version of Carbon Fields? Also, can you confirm that the Icon field is included after the Carbon Fields library?
carbon fields 2.0.2
require POR_INC_LIB_DIR . '/carbon-fields/carbon-fields-plugin.php'; require POR_INC_LIB_DIR . '/carbon-field-icon/core/Icon_Field.php'; require POR_INC_LIB_DIR . '/carbon-field-icon/field.php';
this is call fields. thanks
Carbon Fields are included on the after_setup_theme hook, so you should include the icon field after that. For example:
add_action( 'after_setup_theme', 'crb_include_icon_field', 90 );
function crb_include_icon_field() {
require POR_INC_LIB_DIR . '/carbon-field-icon/core/Icon_Field.php';
require POR_INC_LIB_DIR . '/carbon-field-icon/field.php';
}
thank you its work. Thanks to your help and the carbon fields team is a great project.