carbon-fields icon indicating copy to clipboard operation
carbon-fields copied to clipboard

Icon field won't work

Open sachittandukar opened this issue 9 years ago • 10 comments

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.

sachittandukar avatar Sep 25 '17 12:09 sachittandukar

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

atanas-dev avatar Sep 25 '17 12:09 atanas-dev

Thanks @atanas-angelov-dev

sachittandukar avatar Sep 25 '17 12:09 sachittandukar

is posible install without composer?

dackr avatar Apr 10 '18 14:04 dackr

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.

deqngeorgiev avatar Apr 12 '18 06:04 deqngeorgiev

ok thanks for your help

dackr avatar Apr 13 '18 20:04 dackr

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 avatar Apr 16 '18 22:04 dackr

@dackr - Which is the version of Carbon Fields? Also, can you confirm that the Icon field is included after the Carbon Fields library?

deqngeorgiev avatar Apr 17 '18 06:04 deqngeorgiev

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

dackr avatar Apr 17 '18 13:04 dackr

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';
}

deqngeorgiev avatar Apr 18 '18 06:04 deqngeorgiev

thank you its work. Thanks to your help and the carbon fields team is a great project.

dackr avatar Apr 18 '18 20:04 dackr