register( new ActiveCalculator_Elementor_Widget() ); } add_action( 'elementor/widgets/register', 'activecalculator_register_elementor_widget' ); /** * Draws the ActiveCalculator "ac" mark as the widget icon in the Elementor editor. */ function activecalculator_elementor_editor_styles() { $mark = ""; wp_register_style( 'activecalculator-elementor-editor', false, array(), ACTIVECALCULATOR_VERSION ); wp_enqueue_style( 'activecalculator-elementor-editor' ); wp_add_inline_style( 'activecalculator-elementor-editor', '.activecalculator-elementor-icon::before{content:"";display:inline-block;width:1em;height:1em;background:url("data:image/svg+xml,' . $mark . '") center/contain no-repeat;}' ); } add_action( 'elementor/editor/after_enqueue_styles', 'activecalculator_elementor_editor_styles' );