frontblocks
Last commit date
assets
8 months ago
includes
8 months ago
vendor
8 months ago
frontblocks.php
8 months ago
readme.txt
8 months ago
frontblocks.php
70 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: FrontBlocks for GeneratePress |
| 4 | * Plugin URI: https://wordpress.org/plugins/frontblocks/ |
| 5 | * Description: Blocks and helpers that extends GeneratePress blocks. |
| 6 | * Version: 1.2.1 |
| 7 | * Author: Closemarketing |
| 8 | * Author URI: https://close.marketing |
| 9 | * Text Domain: frontblocks |
| 10 | * Domain Path: /languages |
| 11 | * License: GPL-2.0+ |
| 12 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 13 | * |
| 14 | * Requires at least: 5.0 |
| 15 | * Requires PHP: 7.0 |
| 16 | * |
| 17 | * @package FrontBlocks |
| 18 | * @author Closemarketing |
| 19 | * @copyright 2025 Closemarketing |
| 20 | * @license GPL-2.0+ |
| 21 | * |
| 22 | * @wordpress-plugin |
| 23 | * |
| 24 | * Prefix: frbl_ |
| 25 | */ |
| 26 | |
| 27 | defined( 'ABSPATH' ) || die( 'No script kiddies please!' ); |
| 28 | |
| 29 | define( 'FRBL_VERSION', '1.2.1' ); |
| 30 | define( 'FRBL_PLUGIN', __FILE__ ); |
| 31 | define( 'FRBL_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 32 | define( 'FRBL_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); |
| 33 | |
| 34 | // Load Composer autoloader. |
| 35 | if ( file_exists( FRBL_PLUGIN_PATH . 'vendor/autoload.php' ) ) { |
| 36 | require_once FRBL_PLUGIN_PATH . 'vendor/autoload.php'; |
| 37 | } |
| 38 | |
| 39 | require_once FRBL_PLUGIN_PATH . 'includes/Plugin_Main.php'; |
| 40 | |
| 41 | add_action( |
| 42 | 'plugins_loaded', |
| 43 | function () { |
| 44 | FrontBlocks\Plugin_Main::get_instance(); |
| 45 | } |
| 46 | ); |
| 47 | |
| 48 | /** |
| 49 | * Check if FrontBlocks PRO is active. |
| 50 | * |
| 51 | * @return bool |
| 52 | */ |
| 53 | function frbl_is_pro_active() { |
| 54 | return defined( 'FRBLP_PRO_ACTIVE' ) && FRBLP_PRO_ACTIVE; |
| 55 | } |
| 56 | |
| 57 | /** |
| 58 | * Check if After Add to Cart Block is enabled. |
| 59 | * |
| 60 | * @return bool True if enabled. |
| 61 | */ |
| 62 | function frbl_is_after_add_to_cart_enabled() { |
| 63 | if ( ! frbl_is_pro_active() ) { |
| 64 | return false; |
| 65 | } |
| 66 | |
| 67 | $options = get_option( 'frontblocks_settings', array() ); |
| 68 | return (bool) ( $options['enable_after_add_to_cart'] ?? false ); |
| 69 | } |
| 70 |