=' ) ) { add_action( 'admin_notices', [ $this, 'admin_notice_minimum_elementor_version' ] ); return; } // Check for required PHP version if ( version_compare( PHP_VERSION, self::MINIMUM_PHP_VERSION, '<' ) ) { add_action( 'admin_notices', [ $this, 'admin_notice_minimum_php_version' ] ); return; } // Add actions require_once( get_theme_file_path( '/functions/plugins/elementor/class-mfn-elementor-helper.php' ) ); add_action( 'elementor/elements/categories_registered', 'Mfn_Elementor_Helper::categories_registered' ); add_action( 'elementor/widgets/register', [ $this, 'init_widgets' ] ); add_action( 'elementor/frontend/before_enqueue_scripts', [ $this, 'enqueue_styles' ] ); add_action( 'elementor/editor/before_enqueue_scripts', [ $this, 'enqueue_styles_editor' ] ); } /* * Frontend styles */ public function enqueue_styles() { wp_enqueue_style( 'mfn-elementor', get_theme_file_uri( '/functions/plugins/elementor/assets/elementor.css' ) ); } /* * Editor styles */ public function enqueue_styles_editor() { wp_enqueue_style( 'mfn-elementor-editor', get_theme_file_uri( '/fonts/fontawesome/fontawesome.css' ) ); wp_enqueue_style( 'mfn-elementor-editor', get_theme_file_uri( '/functions/plugins/elementor/assets/elementor-editor.css' ) ); } /** * Admin notice * Warning when the site doesn't have a minimum required Elementor version. */ public function admin_notice_minimum_elementor_version() { // if ( isset( $_GET['activate'] ) ) unset( $_GET['activate'] ); // plugin only $message = 'Theme requires Elementor version '. self::MINIMUM_ELEMENTOR_VERSION .' or greater.'; printf( '
%1$s
%1$s