|
Server : LiteSpeed System : Linux quebec.us.hostns.io 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64 User : gazetufm ( 1431) PHP Version : 8.1.35 Disable Function : NONE Directory : /home2/gazetufm/matrix-financials.com/wp-content/plugins/envo-extra/lib/elementor/ | |
|
Path: //home2/gazetufm/matrix-financials.com/wp-content/plugins/envo-extra/lib/elementor/widgets.php
Size: 4.28 KB
Permissions: 0555
<?php
if ( !defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* Escaped attributes (href, target, rel) for an Elementor URL control value.
*/
function envo_extra_link_attributes( $link ) {
$attr = '';
$rel = array();
if ( !empty( $link[ 'url' ] ) ) {
$attr .= ' href="' . esc_url( $link[ 'url' ] ) . '"';
}
if ( !empty( $link[ 'is_external' ] ) ) {
$attr .= ' target="_blank"';
$rel[] = 'noopener';
}
if ( !empty( $link[ 'nofollow' ] ) ) {
$rel[] = 'nofollow';
}
if ( $rel ) {
$attr .= ' rel="' . esc_attr( implode( ' ', $rel ) ) . '"';
}
return $attr;
}
/**
* Custom widgets for Elementor
*
* This class handles custom widgets for Elementor
*
* @since 1.0.0
*/
#[AllowDynamicProperties]
final class Enwoo_Extra_Elementor_Extension {
private static $_instance = null;
public static function instance() {
if ( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
}
/**
* Registers widgets in Elementor
*
*
* @since 1.0.0
* @access public
*/
public function register_widgets() {
foreach ( $this->modules as $key => $value ) {
require_once ENVO_EXTRA_PATH . 'lib/elementor/widgets/' . $key . '/' . $key . '.php';
\Elementor\Plugin::instance()->widgets_manager->register( new $value[ 'class' ]() );
}
}
/**
* Registers widgets scripts
*
*
* @since 1.0.0
* @access public
*/
public function widget_scripts() {
}
public function editor_scripts() {
wp_register_script( 'preview-script-elmn', ENVO_EXTRA_PLUGIN_URL . 'lib/elementor/assets/js/elementor.js', [ 'elementor-editor' ], ELEMENTOR_VERSION, true );
wp_enqueue_script( 'preview-script-elmn' );
}
/**
* Enqueue widgets scripts in preview mode, as later calls in widgets render will not work,
* as it happens in admin env
*
*
* @since 1.0.0
* @access public
*/
public function widget_scripts_preview() {
}
/**
* Registers widgets styles
*
*
* @since 1.0.0
* @access public
*/
public function widget_styles() {
foreach ( $this->modules as $key => $value ) {
wp_register_style( 'envo-extra-' . $key . '', ENVO_EXTRA_PLUGIN_URL . 'lib/elementor/assets/css/' . $key . '/' . $key . '.css', array(), ENVO_EXTRA_CURRENT_VERSION );
}
wp_register_style( 'font-awesome-5-all', ELEMENTOR_ASSETS_URL . 'lib/font-awesome/css/all.min.css', false, ELEMENTOR_VERSION );
}
public function widget_styles_preview() {
foreach ( $this->modules as $key => $value ) {
wp_register_style( 'envo-extra-' . $key . '', ENVO_EXTRA_PLUGIN_URL . 'lib/elementor/assets/css/' . $key . '/' . $key . '.css', array(), ENVO_EXTRA_CURRENT_VERSION );
}
}
public function add_elementor_widget_categories( $elements_manager ) {
$elements_manager->add_category(
'envo-extra-widgets', [
'title' => __( 'Envo Extra', 'envo-extra' ),
'icon' => 'fa fa-plug',
]
);
}
/**
* Widget constructor.
*
*
* @since 1.0.0
* @access public
*/
public function __construct() {
add_action( 'elementor/widgets/register', [$this, 'register_widgets' ] );
// Register Widget Styles
add_action( 'elementor/frontend/after_register_styles', [$this, 'widget_styles' ] );
//add_action('elementor/frontend/after_enqueue_styles', [ $this, 'enqueue_styles' ]);
add_action( 'elementor/editor/after_enqueue_scripts', [$this, 'editor_scripts' ] );
// Register Widget Scripts
add_action( 'elementor/frontend/after_register_scripts', [$this, 'widget_scripts' ] );
// Enqueue ALL Widgets Scripts for preview
add_action( 'elementor/preview/enqueue_scripts', [$this, 'widget_scripts_preview' ] );
add_action( 'elementor/elements/categories_registered', [$this, 'add_elementor_widget_categories' ] );
add_action( 'elementor/preview/enqueue_styles', [$this, 'widget_styles_preview' ] );
$this->modules = array(
'block-quote' => array(
'class' => 'Envo_Block_Quote',
),
'button' => array(
'class' => 'Button',
),
'counter' => array(
'class' => 'Counter',
),
'heading' => array(
'class' => 'Heading',
),
'team' => array(
'class' => 'Team',
),
'icon-box' => array(
'class' => 'Icon_Box',
),
'pricing' => array(
'class' => 'Pricing',
),
'testimonial' => array(
'class' => 'Testimonial',
),
);
}
}
Enwoo_Extra_Elementor_Extension::instance();