blocks-animation
Last commit date
assets
1 year ago
build
1 day ago
vendor
1 day ago
blocks-animation.php
1 day ago
class-blocks-animation.php
1 day ago
readme.md
1 day ago
readme.txt
1 day ago
blocks-animation.php
91 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Blocks Animation |
| 4 | * |
| 5 | * @package ThemeIsle\GutenbergBlocks\Blocks_Animation |
| 6 | * @copyright Copyright (c) 2019, Hardeep Asrani |
| 7 | * @license http://opensource.org/licenses/gpl-3.0.php GNU Public License |
| 8 | * @since 1.0.0 |
| 9 | * |
| 10 | * Plugin Name: Blocks Animation: CSS Animations for Gutenberg Blocks |
| 11 | * Plugin URI: https://github.com/Codeinwp/otter-blocks |
| 12 | * Description: Blocks Animation allows you to add CSS Animations to all of your Gutenberg blocks in the most elegent way. |
| 13 | * Version: 3.2.0 |
| 14 | * Author: ThemeIsle |
| 15 | * Author URI: https://themeisle.com |
| 16 | * Requires at least: 6.6 |
| 17 | * License: GPL-3.0+ |
| 18 | * License URI: http://www.gnu.org/licenses/gpl-3.0.txt |
| 19 | * Text Domain: blocks-animation |
| 20 | * Domain Path: /languages |
| 21 | * WordPress Available: yes |
| 22 | * Requires License: no |
| 23 | */ |
| 24 | |
| 25 | // If this file is called directly, abort. |
| 26 | if ( ! defined( 'WPINC' ) ) { |
| 27 | die; |
| 28 | } |
| 29 | |
| 30 | if ( defined( 'OTTER_BLOCKS_PATH' ) ) { |
| 31 | return; |
| 32 | } |
| 33 | |
| 34 | define( 'BLOCKS_ANIMATION_URL', plugins_url( '/', __FILE__ ) ); |
| 35 | define( 'BLOCKS_ANIMATION_PATH', __DIR__ ); |
| 36 | define( 'BLOCKS_ANIMATION_PRODUCT_SLUG', basename( BLOCKS_ANIMATION_PATH ) ); |
| 37 | |
| 38 | $vendor_file = BLOCKS_ANIMATION_PATH . '/vendor/autoload.php'; |
| 39 | |
| 40 | if ( is_readable( $vendor_file ) ) { |
| 41 | require_once $vendor_file; |
| 42 | } |
| 43 | |
| 44 | add_filter( |
| 45 | 'themeisle_sdk_products', |
| 46 | function ( $products ) { |
| 47 | $products[] = __FILE__; |
| 48 | |
| 49 | return $products; |
| 50 | } |
| 51 | ); |
| 52 | |
| 53 | add_action( |
| 54 | 'plugins_loaded', |
| 55 | function () { |
| 56 | // call this only if Gutenberg is active. |
| 57 | if ( function_exists( 'register_block_type' ) ) { |
| 58 | require_once __DIR__ . '/class-blocks-animation.php'; |
| 59 | |
| 60 | if ( class_exists( '\ThemeIsle\GutenbergBlocks\Blocks_Animation' ) ) { |
| 61 | \ThemeIsle\GutenbergBlocks\Blocks_Animation::instance(); |
| 62 | } |
| 63 | } |
| 64 | } |
| 65 | ); |
| 66 | |
| 67 | add_filter( |
| 68 | 'themeisle_sdk_blackfriday_data', |
| 69 | function ( $configs ) { |
| 70 | if ( defined( 'OTTER_BLOCKS_PATH' ) ) { |
| 71 | return $configs; |
| 72 | } |
| 73 | |
| 74 | $config = $configs['default']; |
| 75 | |
| 76 | // translators: 1. Number of free licenses, 2. The price of the product. |
| 77 | $config['message'] = sprintf( __( 'You’re using Blocks Animation, and the team behind it is celebrating Black Friday by giving away %1$s licences of Otter Pro. A powerful block collection worth %2$s, with advanced blocks, custom CSS, animations, and WooCommerce integration. Claim yours before they run out.', 'blocks-animation' ), 100, '$69' ); |
| 78 | $config['plugin_meta_message'] = __( 'Black Friday Sale - Get Otter Pro free', 'blocks-animation' ); |
| 79 | $config['sale_url'] = add_query_arg( |
| 80 | array( |
| 81 | 'utm_term' => 'free', |
| 82 | ), |
| 83 | tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/otter-claim-bf', 'bfcm', 'blocks-animation' ) ) |
| 84 | ); |
| 85 | |
| 86 | $configs[ BLOCKS_ANIMATION_PRODUCT_SLUG ] = $config; |
| 87 | |
| 88 | return $configs; |
| 89 | } |
| 90 | ); |
| 91 |