54 lines
1.8 KiB
PHP
54 lines
1.8 KiB
PHP
<?php
|
|
/**
|
|
* Plugin Name: Elementor Addon
|
|
* Description: Simple hello world widgets for Elementor.
|
|
* Version: 1.0.0
|
|
* Author: Elementor Developer
|
|
* Author URI: https://developers.elementor.com/
|
|
* Text Domain: elementor-addon
|
|
*
|
|
* Requires Plugins: elementor
|
|
* Elementor tested up to: 3.21.0
|
|
* Elementor Pro tested up to: 3.21.0
|
|
*/
|
|
|
|
function register_hello_world_widget( $widgets_manager ) {
|
|
require_once( __DIR__ . '/widgets/images-list.php' );
|
|
require_once( __DIR__ . '/widgets/acf-product-parameters.php' );
|
|
require_once( __DIR__ . '/widgets/places-map.php' );
|
|
require_once( __DIR__ . '/widgets/product-featured-image.php' );
|
|
require_once( __DIR__ . '/widgets/acf-product-label.php' );
|
|
|
|
$widgets_manager->register( new \Elementor_Images_List() );
|
|
$widgets_manager->register( new \Elementor_ACF_Product_Parameters() );
|
|
$widgets_manager->register( new \Elementor_Places_Map() );
|
|
$widgets_manager->register( new \Elementor_Product_Featured_Image() );
|
|
$widgets_manager->register( new \Elementor_ACF_Product_Label() );
|
|
}
|
|
add_action( 'elementor/widgets/register', 'register_hello_world_widget' );
|
|
|
|
function enqueue_elementor_addon_styles() {
|
|
if ( did_action( 'elementor/loaded' ) ) {
|
|
wp_enqueue_style(
|
|
'elementor-addon-main-css',
|
|
plugins_url( 'assets/css/main.css', __FILE__ ),
|
|
[],
|
|
'1.0.0'
|
|
);
|
|
}
|
|
}
|
|
add_action( 'wp_enqueue_scripts', 'enqueue_elementor_addon_styles' );
|
|
|
|
|
|
function enqueue_elementor_addon_scripts() {
|
|
if ( did_action( 'elementor/loaded' ) ) {
|
|
wp_enqueue_script(
|
|
'elementor-addon-main-js',
|
|
plugins_url( 'assets/js/main.js', __FILE__ ),
|
|
[ 'jquery' ],
|
|
'1.0.0',
|
|
true
|
|
);
|
|
}
|
|
}
|
|
add_action( 'wp_enqueue_scripts', 'enqueue_elementor_addon_scripts' ); |