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