61 lines
2.0 KiB
PHP
61 lines
2.0 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/category-list.php' );
|
|
require_once( __DIR__ . '/widgets/same-posts-by-category.php' );
|
|
require_once( __DIR__ . '/widgets/category-nav-tree.php' );
|
|
require_once( __DIR__ . '/widgets/scroll-up.php' );
|
|
require_once( __DIR__ . '/widgets/audio-handler.php' );
|
|
require_once( __DIR__ . '/widgets/products-by-category.php' );
|
|
require_once( __DIR__ . '/widgets/langswitcher.php' );
|
|
|
|
$widgets_manager->register( new \Elementor_Category_List() );
|
|
$widgets_manager->register( new \Elementor_Same_Posts_By_Category() );
|
|
$widgets_manager->register( new \Elementor_Category_Nav_Tree() );
|
|
$widgets_manager->register( new \Elementor_Scroll_Up() );
|
|
$widgets_manager->register( new \Elementor_Audio_Handler() );
|
|
$widgets_manager->register( new \Elementor_Products_By_Category() );
|
|
$widgets_manager->register( new \Elementor_LangSwitcher() );
|
|
}
|
|
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' );
|