PluginProbe ʕ •ᴥ•ʔ
GenerateBlocks / 1.0
GenerateBlocks v1.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 1.5.4 1.6.0 1.7.0 1.7.1 1.7.2 1.7.3 1.8.0 1.8.1 1.8.2 1.8.3 1.9.0 1.9.1 2.0.0 2.0.1 2.0.2 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.3.0
generateblocks / plugin.php
generateblocks Last commit date
assets 6 years ago dist 6 years ago includes 6 years ago src 6 years ago .gitattributes 6 years ago .gitignore 6 years ago phpcs.xml 6 years ago plugin.php 6 years ago readme.txt 6 years ago
plugin.php
62 lines
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.0
9 * License: GPL2+
10 * License URI: https://www.gnu.org/licenses/gpl-2.0.txt
11 *
12 * @package GenerateBlocks
13 */
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 define( 'GENERATEBLOCKS_VERSION', '1.0' );
20 define( 'GENERATEBLOCKS_CSS_VERSION', '1.0' );
21 define( 'GENERATEBLOCKS_DIR', plugin_dir_path( __FILE__ ) );
22 define( 'GENERATEBLOCKS_DIR_URL', plugin_dir_url( __FILE__ ) );
23
24 // Load necessary files.
25 require_once GENERATEBLOCKS_DIR . 'includes/functions.php';
26 require_once GENERATEBLOCKS_DIR . 'includes/general.php';
27 require_once GENERATEBLOCKS_DIR . 'includes/defaults.php';
28 require_once GENERATEBLOCKS_DIR . 'includes/generate-css.php';
29 require_once GENERATEBLOCKS_DIR . 'includes/class-do-css.php';
30 require_once GENERATEBLOCKS_DIR . 'includes/class-enqueue-css.php';
31 require_once GENERATEBLOCKS_DIR . 'includes/dashboard.php';
32 require_once GENERATEBLOCKS_DIR . 'includes/class-settings.php';
33
34 add_action( 'plugins_loaded', 'generateblocks_load_plugin_textdomain' );
35 /**
36 * Load GenerateBlocks textdomain.
37 *
38 * Load gettext translate for Elementor text domain.
39 *
40 * @since 1.0
41 *
42 * @return void
43 */
44 function generateblocks_load_plugin_textdomain() {
45 load_plugin_textdomain( 'generateblocks' );
46 }
47
48 /**
49 * Adds a redirect option during plugin activation on non-multisite installs.
50 *
51 * @since 0.1
52 *
53 * @param bool $network_wide Whether or not the plugin is being network activated.
54 */
55 function generateblocks_do_activate( $network_wide = false ) {
56 // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only used to do a redirect. False positive.
57 if ( ! $network_wide && ! isset( $_GET['activate-multi'] ) ) {
58 update_option( 'generateblocks_do_activation_redirect', true );
59 }
60 }
61 register_activation_hook( __FILE__, 'generateblocks_do_activate' );
62