Thz Icon

Thz Icon option type is an option type that will let you select an icon from 3400+ custom picked icons

Thz Icon option type is an option type that will help you select an icon from 3400+ custom picked icons.

option snippet simple

'option_name' => array(
    'type' => 'thz-icon',
    'label' => __('Option label', '{domain}'),
    'desc' => esc_html__('Option description.', '{domain}'),
    'help' => esc_html__('Option help.', '{domain}'),
    'value' => 'thzicon thzicon-themezly',
)

option snippet array

'option_name' => array(
    'type' => 'thz-icon',
    'label' => __('Option label', '{domain}'),
    'desc' => esc_html__('Option description.', '{domain}'),
    'help' => esc_html__('Option help.', '{domain}'),
    'value' => array(
        'icon' => 'thzicon thzicon-themezly',
        'size' => 28,
        'color' => 'color_1'
    ),
)

Adding custom icons to existing icons set

To add custom icons to thz-icon option type add following filter in your child-theme functions.php file;

function my_filter_font_icon_packs ($packs){

    $packs =  array(
        'myicons' => array(
            'title' => 'Icons pack name',
            'css_class_prefix' => 'icon_css_prefix', // eg; fa
            'css_file_path' => thz_theme_file_path('/some_child_theme_folder/style.css'),
            'css_file_uri' => thz_theme_file_uri('/some_child_theme_folder/style.css'),
        )
    );

    return $packs;
}

add_filter('thz_filter_font_icon_packs', 'my_filter_font_icon_packs');

Note that you need to enque frontent icons stylesheet on your own.

Transient used to save custom icon pack is thz_custom_font_icon_packs and is refreshed every 7 days. Transient can be deleted when filter is removed or with delete_transient('thz_custom_font_icon_packs') function.