blocks-animation
Last commit date
assets
1 year ago
build
3 months ago
vendor
1 month ago
blocks-animation.php
1 month ago
class-blocks-animation.php
1 year ago
readme.md
1 month ago
readme.txt
1 month ago
blocks-animation.php
90 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.1.11 |
| 14 | * Author: ThemeIsle |
| 15 | * Author URI: https://themeisle.com |
| 16 | * License: GPL-3.0+ |
| 17 | * License URI: http://www.gnu.org/licenses/gpl-3.0.txt |
| 18 | * Text Domain: blocks-animation |
| 19 | * Domain Path: /languages |
| 20 | * WordPress Available: yes |
| 21 | * Requires License: no |
| 22 | */ |
| 23 | |
| 24 | // If this file is called directly, abort. |
| 25 | if ( ! defined( 'WPINC' ) ) { |
| 26 | die; |
| 27 | } |
| 28 | |
| 29 | if ( defined( 'OTTER_BLOCKS_PATH' ) ) { |
| 30 | return; |
| 31 | } |
| 32 | |
| 33 | define( 'BLOCKS_ANIMATION_URL', plugins_url( '/', __FILE__ ) ); |
| 34 | define( 'BLOCKS_ANIMATION_PATH', __DIR__ ); |
| 35 | define( 'BLOCKS_ANIMATION_PRODUCT_SLUG', basename( BLOCKS_ANIMATION_PATH ) ); |
| 36 | |
| 37 | $vendor_file = BLOCKS_ANIMATION_PATH . '/vendor/autoload.php'; |
| 38 | |
| 39 | if ( is_readable( $vendor_file ) ) { |
| 40 | require_once $vendor_file; |
| 41 | } |
| 42 | |
| 43 | add_filter( |
| 44 | 'themeisle_sdk_products', |
| 45 | function ( $products ) { |
| 46 | $products[] = __FILE__; |
| 47 | |
| 48 | return $products; |
| 49 | } |
| 50 | ); |
| 51 | |
| 52 | add_action( |
| 53 | 'plugins_loaded', |
| 54 | function () { |
| 55 | // call this only if Gutenberg is active. |
| 56 | if ( function_exists( 'register_block_type' ) ) { |
| 57 | require_once __DIR__ . '/class-blocks-animation.php'; |
| 58 | |
| 59 | if ( class_exists( '\ThemeIsle\GutenbergBlocks\Blocks_Animation' ) ) { |
| 60 | \ThemeIsle\GutenbergBlocks\Blocks_Animation::instance(); |
| 61 | } |
| 62 | } |
| 63 | } |
| 64 | ); |
| 65 | |
| 66 | add_filter( |
| 67 | 'themeisle_sdk_blackfriday_data', |
| 68 | function ( $configs ) { |
| 69 | if ( defined( 'OTTER_BLOCKS_PATH' ) ) { |
| 70 | return $configs; |
| 71 | } |
| 72 | |
| 73 | $config = $configs['default']; |
| 74 | |
| 75 | // translators: 1. Number of free licenses, 2. The price of the product. |
| 76 | $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' ); |
| 77 | $config['plugin_meta_message'] = __( 'Black Friday Sale - Get Otter Pro free', 'blocks-animation' ); |
| 78 | $config['sale_url'] = add_query_arg( |
| 79 | array( |
| 80 | 'utm_term' => 'free', |
| 81 | ), |
| 82 | tsdk_translate_link( tsdk_utmify( 'https://themeisle.link/otter-claim-bf', 'bfcm', 'blocks-animation' ) ) |
| 83 | ); |
| 84 | |
| 85 | $configs[ BLOCKS_ANIMATION_PRODUCT_SLUG ] = $config; |
| 86 | |
| 87 | return $configs; |
| 88 | } |
| 89 | ); |
| 90 |