Variable Effect Widget Setup
April 3, 2025 · AI Conversations
User
/*
Plugin Name: Variable Effect Elementor Widget
Description: Adds a custom Elementor widget with animated variable font effects.
Version: 1.0
Author: Your Name
*/
complete above
Plugin Name: Variable Effect Elementor Widget
Description: Adds a custom Elementor widget with animated variable font effects.
Version: 1.0
Author: Your Name
*/
complete above
Assistant
Here’s a more complete and properly formatted version of the plugin header, along with the base plugin file setup for your **Variable Effect Elementor Widget**:
<?php
/**
* Plugin Name: Variable Effect Elementor Widget
* Plugin URI: https://yourwebsite.com/
* Description: Adds a custom Elementor widget that applies animated variable font effects with selectable animation styles.
* Version: 1.0
* Author: Your Name
* Author URI: https://yourwebsite.com/
* License: GPL2+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: variable-effect-widget
* Domain Path: /languages
*/
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Define plugin constants.
define( 'VARIABLE_EFFECT_WIDGET_VERSION', '1.0' );
define( 'VARIABLE_EFFECT_WIDGET_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'VARIABLE_EFFECT_WIDGET_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
// Include the widget file (you'll need to create this file).
function variable_effect_widget_init() {
// Check if Elementor is active and loaded.
if ( did_action( 'elementor/loaded' ) ) {
require_once VARIABLE_EFFECT_WIDGET_PLUGIN_DIR . 'widgets/class-variable-effect-widget.php';
}
}
add_action( 'plugins_loaded', 'variable_effect_widget_init' );
Next step:
– Create a folder named `widgets` inside your plugin directory.
– Inside it, create `class-variable-effect-widget.php` to define the custom Elementor widget class.
Let me know if you want me to help scaffold that widget class too.