PluginProbe
Blocks Starter Templates / trunk
Blocks Starter Templates vtrunk
trunk 1.0.3 1.0.4 1.0.5
blocks-starter-templates / blocks-starter-templates.php

blocks-starter-templates.php in Blocks Starter Templates trunk, at blocks-starter-templates.php

46 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Blocks Starter Templates
4 * Plugin URI: https://wp-fse.com/
5 * Description: Gutenberg starter templates and patterns
6 * Version: 1.0.5
7 * Author: Blocks WP
8 * Author URI: https://blocks-wp.com/
9 * License: GPL-2.0+
10 * Text Domain: wpst-block-templates
11 *
12 * @package Blocks Starter Templates
13 */
14 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
15
16 if ( class_exists( 'WPST_Block_Templates' ) ) {
17 return;
18 }
19
20 // Set constants.
21 if ( ! defined( 'WPST_BLOCK_TEMPLATES_LIBRARY_URL' ) ) {
22 define( 'WPST_BLOCK_TEMPLATES_LIBRARY_URL', apply_filters( 'wpst_block_templates_library_url', 'https://wp-fse.com/' ) );
23 }
24
25 define( 'WPST_BLOCK_TEMPLATES_VER', '1.0.5' );
26 define( 'WPST_BLOCK_TEMPLATES_FILE', __FILE__ );
27 define( 'WPST_BLOCK_TEMPLATES_BASE', plugin_basename( WPST_BLOCK_TEMPLATES_FILE ) );
28 define( 'WPST_BLOCK_TEMPLATES_DIR', plugin_dir_path( WPST_BLOCK_TEMPLATES_FILE ) );
29 define( 'WPST_BLOCK_TEMPLATES_URI', plugins_url( '/', WPST_BLOCK_TEMPLATES_FILE ) );
30
31 require_once WPST_BLOCK_TEMPLATES_DIR . 'classes/class-wpst-block-templates.php';
32 add_action(
33 'plugins_loaded',
34 function () {
35 // call this only if Gutenberg is active.
36 if ( function_exists( 'register_block_type' ) ) {
37 require_once dirname( __FILE__ ) . '/build/class-blocks-export-import.php';
38
39 if ( class_exists( '\WPST\GutenbergBlocks\WPST_Block_Templates_Export_Import' ) ) {
40 \WPST\GutenbergBlocks\WPST_Block_Templates_Export_Import::instance();
41 }
42 }
43 }
44 );
45
46