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
59 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.1 |
| 9 | * License: GPL2+ |
| 10 | * License URI: https://www.gnu.org/licenses/gpl-2.0.txt |
| 11 | * Text Domain: generateblocks |
| 12 | * |
| 13 | * @package GenerateBlocks |
| 14 | */ |
| 15 | |
| 16 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | exit; // Exit if accessed directly. |
| 18 | } |
| 19 | |
| 20 | define( 'GENERATEBLOCKS_VERSION', '1.0.1' ); |
| 21 | define( 'GENERATEBLOCKS_CSS_VERSION', '1.0' ); |
| 22 | define( 'GENERATEBLOCKS_DIR', plugin_dir_path( __FILE__ ) ); |
| 23 | define( 'GENERATEBLOCKS_DIR_URL', plugin_dir_url( __FILE__ ) ); |
| 24 | |
| 25 | // Load necessary files. |
| 26 | require_once GENERATEBLOCKS_DIR . 'includes/functions.php'; |
| 27 | require_once GENERATEBLOCKS_DIR . 'includes/general.php'; |
| 28 | require_once GENERATEBLOCKS_DIR . 'includes/defaults.php'; |
| 29 | require_once GENERATEBLOCKS_DIR . 'includes/generate-css.php'; |
| 30 | require_once GENERATEBLOCKS_DIR . 'includes/class-do-css.php'; |
| 31 | require_once GENERATEBLOCKS_DIR . 'includes/class-enqueue-css.php'; |
| 32 | require_once GENERATEBLOCKS_DIR . 'includes/dashboard.php'; |
| 33 | require_once GENERATEBLOCKS_DIR . 'includes/class-settings.php'; |
| 34 | |
| 35 | add_action( 'plugins_loaded', 'generateblocks_load_plugin_textdomain' ); |
| 36 | /** |
| 37 | * Load GenerateBlocks textdomain. |
| 38 | * |
| 39 | * @since 1.0 |
| 40 | */ |
| 41 | function generateblocks_load_plugin_textdomain() { |
| 42 | load_plugin_textdomain( 'generateblocks' ); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Adds a redirect option during plugin activation on non-multisite installs. |
| 47 | * |
| 48 | * @since 0.1 |
| 49 | * |
| 50 | * @param bool $network_wide Whether or not the plugin is being network activated. |
| 51 | */ |
| 52 | function generateblocks_do_activate( $network_wide = false ) { |
| 53 | // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only used to do a redirect. False positive. |
| 54 | if ( ! $network_wide && ! isset( $_GET['activate-multi'] ) ) { |
| 55 | update_option( 'generateblocks_do_activation_redirect', true ); |
| 56 | } |
| 57 | } |
| 58 | register_activation_hook( __FILE__, 'generateblocks_do_activate' ); |
| 59 |