Skip to content

Instantly share code, notes, and snippets.

@prosenjit-manna
Created November 30, 2016 10:05
Show Gist options
  • Save prosenjit-manna/e48484dfb8a0f88ddfb5583ba9d5a4a2 to your computer and use it in GitHub Desktop.
Save prosenjit-manna/e48484dfb8a0f88ddfb5583ba9d5a4a2 to your computer and use it in GitHub Desktop.
function hl_theme_icons() {
return array(
array( 'hl-icon-commerce' => __( 'Commerce', 'js_composer' ) ),
array( 'hl-icon-cup-and-plate' => __( 'cup and plate', 'js_composer' ) ),
array( 'hl-icon-envelope2' => __( 'envelope2', 'js_composer' ) ),
array( 'hl-icon-facebook2' => __( 'facebook2', 'js_composer' ) ),
array( 'hl-icon-favorite' => __( 'favorite', 'js_composer' ) ),
);
}
function hl_icon_library_style_enqueue()
{
wp_register_style( 'hlicon', get_template_directory_uri() . '/css/hlicon.css', array(), 'v1' );
wp_enqueue_style( 'hlicon' );
}
add_action( 'admin_enqueue_scripts', 'hl_icon_library_style_enqueue' );
$attributes = array(
'type' => 'iconpicker',
'heading' => __( 'Icon', 'js_composer' ),
'param_name' => 'i_icon_halmritea',
'settings' => array(
'emptyIcon' => false,
'type' => 'halmritea',
'source' => hl_theme_icons(),
),
'dependency' => array(
'element' => 'i_type',
'value' => 'halmritea',
),
'description' => __( 'Select icon from library.', 'js_composer' ),
);
vc_add_param( 'vc_btn', $attributes );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment