Save
This commit is contained in:
86
wp-content/plugins/elementor-addon/elementor-addon.php
Normal file
86
wp-content/plugins/elementor-addon/elementor-addon.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?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
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register widget files
|
||||
*/
|
||||
function register_hello_world_widget( $widgets_manager ) {
|
||||
require_once( __DIR__ . '/widgets/apartaments.php' );
|
||||
|
||||
$widgets_manager->register( new \Elementor_Apartaments() );
|
||||
}
|
||||
add_action( 'elementor/widgets/register', 'register_hello_world_widget' );
|
||||
|
||||
/**
|
||||
* Register scripts/styles only.
|
||||
* Do not enqueue them globally.
|
||||
*/
|
||||
function elementor_addon_register_assets() {
|
||||
|
||||
// Swiper CSS
|
||||
wp_register_style(
|
||||
'elementor-addon-swiper',
|
||||
plugins_url( 'plugins/swiper/swiper-bundle.min.css', __FILE__ ),
|
||||
[],
|
||||
'11.0.0'
|
||||
);
|
||||
|
||||
// Fancybox CSS
|
||||
wp_register_style(
|
||||
'elementor-addon-fancybox',
|
||||
'https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.css',
|
||||
[],
|
||||
'5.0'
|
||||
);
|
||||
|
||||
// Widget CSS
|
||||
wp_register_style(
|
||||
'elementor-addon-main-css',
|
||||
plugins_url( 'assets/css/main.css', __FILE__ ),
|
||||
[ 'elementor-addon-swiper', 'elementor-addon-fancybox' ],
|
||||
'1.0.0'
|
||||
);
|
||||
|
||||
// Swiper JS
|
||||
wp_register_script(
|
||||
'elementor-addon-swiper',
|
||||
plugins_url( 'plugins/swiper/swiper-bundle.min.js', __FILE__ ),
|
||||
[],
|
||||
'11.0.0',
|
||||
true
|
||||
);
|
||||
|
||||
// Fancybox JS
|
||||
wp_register_script(
|
||||
'elementor-addon-fancybox',
|
||||
'https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0/dist/fancybox/fancybox.umd.js',
|
||||
[],
|
||||
'5.0',
|
||||
true
|
||||
);
|
||||
|
||||
// Widget JS
|
||||
wp_register_script(
|
||||
'elementor-addon-main-js',
|
||||
plugins_url( 'assets/js/main.js', __FILE__ ),
|
||||
[ 'jquery', 'elementor-addon-swiper', 'elementor-addon-fancybox' ],
|
||||
'1.0.0',
|
||||
true
|
||||
);
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'elementor_addon_register_assets' );
|
||||
Reference in New Issue
Block a user