PluginProbe
GenerateBlocks / 1.3.1
GenerateBlocks v1.3.1
2.4.1 2.4.0 trunk 1.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.5.0 1.5.1 1.5.2 1.5.3 All 46 releases
generateblocks / plugin.php

plugin.php in GenerateBlocks 1.3.1, at plugin.php

63 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: GenerateBlocks
4 * Plugin URI: https://generateblocks.com
5 * Description: A small collection of lightweight WordPress blocks that can accomplish nearly anything.
6 * Author: Tom Usborne
7 * Author URI: https://tomusborne.com
8 * Version: 1.3.1
9 * Requires at least: 5.4
10 * Requires PHP: 5.6
11 * License: GPL2+
12 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt
13 * Text Domain: generateblocks
14 *
15 * @package GenerateBlocks
16 */
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit; // Exit if accessed directly.
20 }
21
22 define( 'GENERATEBLOCKS_VERSION', '1.3.1' );
23 define( 'GENERATEBLOCKS_DIR', plugin_dir_path( __FILE__ ) );
24 define( 'GENERATEBLOCKS_DIR_URL', plugin_dir_url( __FILE__ ) );
25
26 // Load necessary files.
27 require_once GENERATEBLOCKS_DIR . 'includes/functions.php';
28 require_once GENERATEBLOCKS_DIR . 'includes/general.php';
29 require_once GENERATEBLOCKS_DIR . 'includes/defaults.php';
30 require_once GENERATEBLOCKS_DIR . 'includes/generate-css.php';
31 require_once GENERATEBLOCKS_DIR . 'includes/class-do-css.php';
32 require_once GENERATEBLOCKS_DIR . 'includes/class-enqueue-css.php';
33 require_once GENERATEBLOCKS_DIR . 'includes/dashboard.php';
34 require_once GENERATEBLOCKS_DIR . 'includes/class-settings.php';
35 require_once GENERATEBLOCKS_DIR . 'includes/class-plugin-update.php';
36 require_once GENERATEBLOCKS_DIR . 'includes/class-render-blocks.php';
37 require_once GENERATEBLOCKS_DIR . 'includes/class-rest.php';
38
39 add_action( 'plugins_loaded', 'generateblocks_load_plugin_textdomain' );
40 /**
41 * Load GenerateBlocks textdomain.
42 *
43 * @since 1.0
44 */
45 function generateblocks_load_plugin_textdomain() {
46 load_plugin_textdomain( 'generateblocks' );
47 }
48
49 /**
50 * Adds a redirect option during plugin activation on non-multisite installs.
51 *
52 * @since 0.1
53 *
54 * @param bool $network_wide Whether or not the plugin is being network activated.
55 */
56 function generateblocks_do_activate( $network_wide = false ) {
57 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only used to do a redirect. False positive.
58 if ( ! $network_wide && ! isset( $_GET['activate-multi'] ) ) {
59 update_option( 'generateblocks_do_activation_redirect', true );
60 }
61 }
62 register_activation_hook( __FILE__, 'generateblocks_do_activate' );
63