timeline-blocks
Last commit date
dist
1 week ago
src
1 week ago
readme.txt
1 week ago
timeline-blocks.php
1 week ago
timeline-blocks.php
68 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: Timeline Blocks for Gutenberg |
| 4 | * Plugin URI: https://wordpress.org/plugins/timeline-blocks/ |
| 5 | * Description: A beautiful timeline block to showcase your posts in timeline presentation with multiple templates availability. |
| 6 | * Author: Techeshta |
| 7 | * Author URI: https://www.techeshta.com |
| 8 | * Version: 2.0.0 |
| 9 | * Requires at least: 5.0 |
| 10 | * Requires PHP: 5.6 |
| 11 | * License: GPL2+ |
| 12 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 13 | * Text Domain: timeline-blocks |
| 14 | */ |
| 15 | |
| 16 | /** |
| 17 | * Exit if accessed directly |
| 18 | */ |
| 19 | if ( ! defined( 'ABSPATH' ) ) { |
| 20 | exit; |
| 21 | } |
| 22 | |
| 23 | // Define plugin constants |
| 24 | define( 'TB_DOMAIN', 'timeline-blocks' ); |
| 25 | define( 'TB_DIR', plugin_dir_path( __FILE__ ) ); |
| 26 | |
| 27 | /** |
| 28 | * Initialize and load the plugin block functionality. |
| 29 | * |
| 30 | * @since 1.0.0 |
| 31 | */ |
| 32 | function timeline_blocks_loader() { |
| 33 | /** |
| 34 | * Load the blocks functionality |
| 35 | */ |
| 36 | require_once plugin_dir_path( __FILE__ ) . 'dist/init.php'; |
| 37 | |
| 38 | /** |
| 39 | * Load Post Grid PHP |
| 40 | */ |
| 41 | require_once plugin_dir_path( __FILE__ ) . 'src/blocks/index.php'; |
| 42 | } |
| 43 | add_action( 'plugins_loaded', 'timeline_blocks_loader' ); |
| 44 | |
| 45 | /** |
| 46 | * Handle options and redirects on plugin activation. |
| 47 | * |
| 48 | * @since 1.0.0 |
| 49 | */ |
| 50 | function timeline_blocks_activate() { |
| 51 | add_option( 'tb_timeline_gutenberg_do_activation_redirect', true ); |
| 52 | } |
| 53 | register_activation_hook( __FILE__, 'timeline_blocks_activate' ); |
| 54 | |
| 55 | /** |
| 56 | * Register custom image sizes for the timeline layout templates. |
| 57 | * |
| 58 | * @since 1.0.0 |
| 59 | */ |
| 60 | function timeline_blocks_image_sizes() { |
| 61 | // Add custom landscape size for timeline images |
| 62 | add_image_size( 'tb-timeline-landscape', 600, 400, true ); |
| 63 | // Add custom square size for timeline images |
| 64 | add_image_size( 'tb-timeline-square', 600, 600, true ); |
| 65 | } |
| 66 | add_action( 'after_setup_theme', 'timeline_blocks_image_sizes' ); |
| 67 | |
| 68 |