Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions classes/controllers/FrmElementorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,33 @@ public static function register_elementor_hooks() {
require_once FrmAppHelper::plugin_path() . '/classes/widgets/FrmElementorWidget.php';
\Elementor\Plugin::instance()->widgets_manager->register( new \FrmElementorWidget() );

if ( is_admin() ) {
add_action(
'elementor/editor/after_enqueue_styles',
function () {
wp_enqueue_style( 'font_icons', FrmAppHelper::plugin_url() . '/css/font_icons.css', array(), FrmAppHelper::plugin_version() );
}
);
add_action( 'elementor/editor/after_enqueue_styles', array( self::class, 'enqueue_editor_styles' ) );
}

/**
* Enqueue styles for the Elementor editor to display the Formidable widget icon.
*
* @since x.x
Comment thread
shervElmi marked this conversation as resolved.
*
* @return void
*/
Comment thread
shervElmi marked this conversation as resolved.
public static function enqueue_editor_styles() {
$icon = rawurlencode( FrmAppHelper::svg_logo() );
$css = '
.elementor-element .icon .frm_logo_icon {
display: flex;
align-items: center;
justify-content: center;
}
.elementor-element .icon .frm_logo_icon::before {
content: "";
display: block;
width: 28px;
height: 28px;
background: url("data:image/svg+xml,' . $icon . '") center / contain no-repeat;
}';

wp_add_inline_style( 'elementor-editor', $css );
}

/**
Expand Down