2FOX4. * Version: 1.1.3 * Author: Oliver Deppe * Author URI: https://www.2fox4.de/wordpress-plugins/ * License: GPL-2.0-or-later * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Text Domain: 2fox4-before-after * Domain Path: /languages * Requires at least: 6.4 * Requires PHP: 8.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } /** * Plugin version constant. */ define( 'BFAS_VERSION', '1.1.3' ); /** * Plugin directory path. */ define( 'BFAS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); /** * Plugin directory URL. */ define( 'BFAS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); /** * Plugin basename. */ define( 'BFAS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); /** * Include required files. */ require_once BFAS_PLUGIN_DIR . 'includes/class-bfas-coffee-notice.php'; require_once BFAS_PLUGIN_DIR . 'includes/class-bfas-shortcode.php'; require_once BFAS_PLUGIN_DIR . 'includes/class-bfas-block.php'; /** * Activation hook. */ function bfas_activate() { BFAS_Coffee_Notice::activate(); } register_activation_hook( __FILE__, 'bfas_activate' ); /** * Initialize coffee notice on admin. */ function bfas_init_coffee_notice() { $coffee_notice = new BFAS_Coffee_Notice(); $coffee_notice->init(); } add_action( 'admin_init', 'bfas_init_coffee_notice' ); /** * Initialize shortcode. */ function bfas_init_shortcode() { $shortcode = new BFAS_Shortcode(); $shortcode->init(); } add_action( 'init', 'bfas_init_shortcode' ); /** * Initialize Gutenberg block. */ function bfas_init_block() { $block = new BFAS_Block(); $block->init(); } add_action( 'init', 'bfas_init_block' ); /** * Register frontend assets. */ function bfas_register_assets() { wp_register_style( 'bfas-frontend', BFAS_PLUGIN_URL . 'public/css/bfas-frontend.css', array(), BFAS_VERSION ); wp_register_script( 'bfas-frontend', BFAS_PLUGIN_URL . 'public/js/bfas-frontend.js', array(), BFAS_VERSION, true ); } add_action( 'wp_enqueue_scripts', 'bfas_register_assets' ); /** * Register editor assets. */ function bfas_register_editor_assets() { wp_register_style( 'bfas-editor', BFAS_PLUGIN_URL . 'admin/css/bfas-editor.css', array(), BFAS_VERSION ); } add_action( 'admin_enqueue_scripts', 'bfas_register_editor_assets' ); /** * Load Elementor widget. */ function bfas_elementor_init() { if ( did_action( 'elementor/loaded' ) ) { require_once BFAS_PLUGIN_DIR . 'includes/class-bfas-elementor-widget.php'; } } add_action( 'plugins_loaded', 'bfas_elementor_init' );