Skip to content

Instantly share code, notes, and snippets.

@shaddam
Created April 15, 2020 06:20
Show Gist options
  • Select an option

  • Save shaddam/52211ad326a97dc9c17be2c5eb9c1817 to your computer and use it in GitHub Desktop.

Select an option

Save shaddam/52211ad326a97dc9c17be2c5eb9c1817 to your computer and use it in GitHub Desktop.
how to add custom icom in elementor
<?php
namespace DrawCon;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
class Draw_Con_Icon_Manager{
private static $instance = null;
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}
function __construct(){
$this->init();
}
public function init() {
// Custom icon filter
add_filter( 'elementor/icons_manager/additional_tabs', [ $this,'draw_con_flat_icon'] );
}
public function draw_con_flat_icon( $args = array() ) {
// Append new icons
$new_icons = array(
'001-worker-1',
'002-welding',
'003-waste',
'004-walkie-talkie',
'005-valve',
'006-truck',
'007-tools',
'008-machine-1',
'009-storage',
'010-tank-1',
'011-siren:before',
'012-scheme:before',
'013-danger',
'014-robot-arm',
'015-cart',
'016-gear',
'017-pump',
'018-power-tower',
'019-power-press',
'020-planning',
'021-worker',
'022-tank',
'023-microprocessor',
'024-statistics',
'025-meter',
'026-mechanism',
'027-material',
'028-manufacturing-plant',
'029-manufacturing',
'030-management',
'031-machine',
'032-gears-1',
'033-laser',
'034-industrial-robot',
'035-parcel',
'036-gears',
'037-forklift',
'038-food',
'039-factory-1',
'040-factory',
'041-eco',
'042-monitor',
'043-wheel',
'044-conveyor',
'045-controller',
'046-control-system',
'047-control-lever',
'048-chemical',
'049-container',
'050-boxes'
);
$args['draw-con-flaticon'] = array(
'name' => 'draw-con-flaticon',
'label' => esc_html__( 'Draw Flat Icons', 'draw-construction' ),
'labelIcon' => 'fas fa-user',
'prefix' => 'flaticon-',
'displayPrefix' => '',
'url' => DRAW_CON_ASSETS . 'css/flaticon.min.css',
'icons' => $new_icons,
'ver' => DRAW_CON_VERSION,
);
return $args;
}
}
Draw_Con_Icon_Manager::instance();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment