| 1 |
<?php |
| 2 |
/** |
| 3 |
* The plugin bootstrap file |
| 4 |
* |
| 5 |
* This file is read by WordPress to generate the plugin information in the plugin |
| 6 |
* admin area. This file also includes all of the dependencies used by the plugin, |
| 7 |
* registers the activation and deactivation functions, and defines a function |
| 8 |
* that starts the plugin. |
| 9 |
* |
| 10 |
* @link http://wptablebuilder.com/ |
| 11 |
* @since 1.0.0 |
| 12 |
* @package WP_Table_Builder |
| 13 |
* |
| 14 |
* @wordpress-plugin |
| 15 |
* Plugin Name: WP Table Builder |
| 16 |
* Plugin URI: https://wptablebuilder.com/ |
| 17 |
* Description: Drag and Drop Table Builder Plugin for WordPress. |
| 18 |
* Version: 1.0.2 |
| 19 |
* Author: Imtiaz Rayhan |
| 20 |
* Author URI: https://imtiazrayhan.com// |
| 21 |
* License: GPL-3.0+ |
| 22 |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt |
| 23 |
* Text Domain: wp-table-builder |
| 24 |
* Domain Path: /languages |
| 25 |
*/ |
| 26 |
|
| 27 |
namespace WP_Table_Builder; |
| 28 |
|
| 29 |
// If this file is called directly, abort. |
| 30 |
if ( ! defined( 'WPINC' ) ) { |
| 31 |
die; |
| 32 |
} |
| 33 |
|
| 34 |
/** |
| 35 |
* Define Constants |
| 36 |
*/ |
| 37 |
|
| 38 |
define( __NAMESPACE__ . '\NS', __NAMESPACE__ . '\\' ); |
| 39 |
|
| 40 |
define( NS . 'WP_TABLE_BUILDER', 'wp-table-builder' ); |
| 41 |
|
| 42 |
define( NS . 'PLUGIN_VERSION', '1.0.2' ); |
| 43 |
|
| 44 |
define( NS . 'WP_TABLE_BUILDER_DIR', plugin_dir_path( __FILE__ ) ); |
| 45 |
|
| 46 |
define( NS . 'WP_TABLE_BUILDER_URL', plugin_dir_url( __FILE__ ) ); |
| 47 |
|
| 48 |
define( NS . 'PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
| 49 |
|
| 50 |
define( NS . 'PLUGIN_TEXT_DOMAIN', 'wp-table-builder' ); |
| 51 |
|
| 52 |
|
| 53 |
/** |
| 54 |
* Autoload Classes |
| 55 |
*/ |
| 56 |
|
| 57 |
require_once( WP_TABLE_BUILDER_DIR . 'inc/libraries/autoloader.php' ); |
| 58 |
|
| 59 |
/** |
| 60 |
* Helper Functions |
| 61 |
*/ |
| 62 |
|
| 63 |
/** |
| 64 |
* Register Activation and Deactivation Hooks |
| 65 |
* This action is documented in inc/core/class-activator.php |
| 66 |
*/ |
| 67 |
|
| 68 |
register_activation_hook( __FILE__, array( NS . 'Inc\Core\Activator', 'activate' ) ); |
| 69 |
|
| 70 |
/** |
| 71 |
* The code that runs during plugin deactivation. |
| 72 |
* This action is documented inc/core/class-deactivator.php |
| 73 |
*/ |
| 74 |
|
| 75 |
register_deactivation_hook( __FILE__, array( NS . 'Inc\Core\Deactivator', 'deactivate' ) ); |
| 76 |
|
| 77 |
|
| 78 |
/** |
| 79 |
* Plugin Singleton Container |
| 80 |
* |
| 81 |
* Maintains a single copy of the plugin app object |
| 82 |
* |
| 83 |
* @since 1.0.0 |
| 84 |
*/ |
| 85 |
class WP_Table_Builder { |
| 86 |
|
| 87 |
/** |
| 88 |
* The instance of the plugin. |
| 89 |
* |
| 90 |
* @since 1.0.0 |
| 91 |
* @var Init $init Instance of the plugin. |
| 92 |
*/ |
| 93 |
private static $init; |
| 94 |
/** |
| 95 |
* Loads the plugin |
| 96 |
* |
| 97 |
* @access public |
| 98 |
*/ |
| 99 |
public static function init() { |
| 100 |
|
| 101 |
if ( null === self::$init ) { |
| 102 |
self::$init = new Inc\Core\Init(); |
| 103 |
self::$init->run(); |
| 104 |
} |
| 105 |
|
| 106 |
return self::$init; |
| 107 |
} |
| 108 |
|
| 109 |
} |
| 110 |
|
| 111 |
/** |
| 112 |
* Begins execution of the plugin |
| 113 |
* |
| 114 |
* Since everything within the plugin is registered via hooks, |
| 115 |
* then kicking off the plugin from this point in the file does |
| 116 |
* not affect the page life cycle. |
| 117 |
* |
| 118 |
* Also returns copy of the app object so 3rd party developers |
| 119 |
* can interact with the plugin's hooks contained within. |
| 120 |
**/ |
| 121 |
function wp_table_builder_init() { |
| 122 |
return WP_Table_Builder::init(); |
| 123 |
} |
| 124 |
|
| 125 |
$min_php = '5.6.0'; |
| 126 |
|
| 127 |
// Check the minimum required PHP version and run the plugin. |
| 128 |
if ( version_compare( PHP_VERSION, $min_php, '>=' ) ) { |
| 129 |
wp_table_builder_init(); |
| 130 |
} |
| 131 |
|