2017 © Pedro Peláez
 

library carbon-field-icon

Carbon Fields extension, that adds a Icon field type.

image

htmlburger/carbon-field-icon

Carbon Fields extension, that adds a Icon field type.

  • Thursday, January 4, 2018
  • by htmlburger-git
  • Repository
  • 4 Watchers
  • 4 Stars
  • 1,310 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 4 Open issues
  • 7 Versions
  • 31 % Grown

The README.md

Carbon Field Icon

Packagist, (*1)

Provides the ability to select an icon or a glyph., (*2)

Supported glyphs

  • Font Awesome (v5.8.1)
  • Dashicons
  • Custom

Usage

Font Awesome only (default):, (*3)

Field::make( 'icon', 'social_site_icon', __( 'Icon', 'crb' ) ),

Dashicons only:, (*4)

Field::make( 'icon', 'social_site_icon', __( 'Icon', 'crb' ) )
    ->add_dashicons_options(),

Dashicons and Font Awesome:, (*5)

Field::make( 'icon', 'social_site_icon', __( 'Icon', 'crb' ) )
    ->add_dashicons_options()
    ->add_fontawesome_options(),

Custom icon list:, (*6)

Field::make( 'icon', 'social_site_icon', __( 'Icon', 'crb' ) )
    ->set_options( array(
        // Minimal settings:
        'my-custom-icon-1' => array(
            'name' => __( 'My Custom Icon 1' ),
            'icon' => get_template_directory() . '/icons/my-custom-icon-1.svg',
        ),

        // Full settings:
        'my-custom-icon-2' => array(
            'name'         => __( 'My Custom Icon 2' ),
            'icon'         => get_template_directory() . '/icons/my-custom-icon-2.svg',
            'id'           => 'my-custom-icon-2',
            'class'        => 'my-custom-prefix-class',
            'search_terms' => array( 'shop', 'checkout', 'product' ),
        ),
    ) ),

Custom icon list (using providers):, (*7)

class Custom_Icon_Provider implements Carbon_Field_Icon\Providers\Icon_Provider_Interface {
    public function parse_options() {
        return array(
            // Minimal settings:
            'custom-icon-1' => array(
                'name' => __( 'Custom Icon 1' ),
                'icon' => get_template_directory() . '/icons/custom-icon-1.svg',
            ),

            // Full settings:
            'custom-icon-2' => array(
                'name'         => __( 'Custom Icon 2' ),
                'icon'         => get_template_directory() . '/icons/custom-icon-2.svg',
                'id'           => 'custom-icon-2',
                'class'        => 'custom-prefix-class',
                'search_terms' => array( 'shop', 'checkout', 'product' ),
            ),
        );
    }
}

add_action( 'carbon_fields_icon_field_loaded', 'crb_register_custom_icon_field_provider' );
function crb_register_custom_icon_field_provider() {
    $provider_id = 'custom';

    \Carbon_Fields\Carbon_Fields::instance()->ioc['icon_field_providers'][ $provider_id ] = function( $container ) {
        return new Custom_Icon_Provider();
    };

    \Carbon_Field_Icon\Icon_Field::add_provider( [ $provider_id ] );
}

Container::make( 'theme_options', __( 'Theme Options', 'crb' ) )
    ->set_page_file( 'crbn-theme-options.php' )
    ->add_fields( array(
        Field::make( 'icon', 'crb_custom_icon', __( 'Choose Custom Icon', 'crb' ) )
            ->add_provider_options( 'custom' ),
    ) );

The Versions

04/01 2018

dev-master

9999999-dev

Carbon Fields extension, that adds a Icon field type.

  Sources   Download

GPL-2.0+ GPL-2.0

The Requires

 

by Yuliyan Slavchev

wordpress carbon-field carbon-field-icon

04/01 2018

2.2.0-beta.1

2.2.0.0-beta1

Carbon Fields extension, that adds a Icon field type.

  Sources   Download

GPL-2.0+

The Requires

 

wordpress carbon-field carbon-field-icon

04/01 2018

2.2.0

2.2.0.0

Carbon Fields extension, that adds a Icon field type.

  Sources   Download

GPL-2.0+

The Requires

 

wordpress carbon-field carbon-field-icon

02/08 2017

2.0.0

2.0.0.0

Carbon Fields extension, that adds a Icon field type.

  Sources   Download

GPL-2.0+

The Requires

 

wordpress carbon-field carbon-field-icon

23/12 2016

v1.0.2

1.0.2.0 http://carbonfields.net/

Extends the base Carbon Fields with an Icon field.

  Sources   Download

GPL-2.0

The Requires

 

by Yuliyan Slavchev

23/12 2016

v1.0.1

1.0.1.0 http://carbonfields.net/

Extends the base Carbon Fields with an Icon field.

  Sources   Download

GPL-2.0

The Requires

 

by Yuliyan Slavchev

23/12 2016

v1.0.0

1.0.0.0 http://carbonfields.net/

Extends the base Carbon Fields with an Icon field.

  Sources   Download

GPL-2.0

The Requires

 

by Yuliyan Slavchev