| 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.7.0 |
| 9 |
* Requires at least: 5.9 |
| 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.7.0' ); |
| 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/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 |
require_once GENERATEBLOCKS_DIR . 'includes/class-plugin-update.php'; |
| 35 |
require_once GENERATEBLOCKS_DIR . 'includes/class-query-loop.php'; |
| 36 |
require_once GENERATEBLOCKS_DIR . 'includes/class-dynamic-content.php'; |
| 37 |
require_once GENERATEBLOCKS_DIR . 'includes/class-render-blocks.php'; |
| 38 |
require_once GENERATEBLOCKS_DIR . 'includes/class-rest.php'; |
| 39 |
require_once GENERATEBLOCKS_DIR . 'includes/class-legacy-attributes.php'; |
| 40 |
|
| 41 |
// Blocks. |
| 42 |
require_once GENERATEBLOCKS_DIR . 'includes/blocks/class-button.php'; |
| 43 |
require_once GENERATEBLOCKS_DIR . 'includes/blocks/class-container.php'; |
| 44 |
require_once GENERATEBLOCKS_DIR . 'includes/blocks/class-button-container.php'; |
| 45 |
require_once GENERATEBLOCKS_DIR . 'includes/blocks/class-grid.php'; |
| 46 |
require_once GENERATEBLOCKS_DIR . 'includes/blocks/class-headline.php'; |
| 47 |
require_once GENERATEBLOCKS_DIR . 'includes/blocks/class-image.php'; |
| 48 |
require_once GENERATEBLOCKS_DIR . 'includes/blocks/class-query-loop.php'; |
| 49 |
|
| 50 |
add_action( 'plugins_loaded', 'generateblocks_load_plugin_textdomain' ); |
| 51 |
/** |
| 52 |
* Load GenerateBlocks textdomain. |
| 53 |
* |
| 54 |
* @since 1.0 |
| 55 |
*/ |
| 56 |
function generateblocks_load_plugin_textdomain() { |
| 57 |
load_plugin_textdomain( 'generateblocks' ); |
| 58 |
} |
| 59 |
|
| 60 |
/** |
| 61 |
* Adds a redirect option during plugin activation on non-multisite installs. |
| 62 |
* |
| 63 |
* @since 0.1 |
| 64 |
* |
| 65 |
* @param bool $network_wide Whether or not the plugin is being network activated. |
| 66 |
*/ |
| 67 |
function generateblocks_do_activate( $network_wide = false ) { |
| 68 |
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Only used to do a redirect. False positive. |
| 69 |
if ( ! $network_wide && ! isset( $_GET['activate-multi'] ) ) { |
| 70 |
update_option( 'generateblocks_do_activation_redirect', true ); |
| 71 |
} |
| 72 |
} |
| 73 |
register_activation_hook( __FILE__, 'generateblocks_do_activate' ); |
| 74 |
|