PluginProbe
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables / 2.1.0
TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables v2.1.0
2.3.0 2.2.14 2.2.13 2.2.12 2.2.11 2.2.10 2.2.9 2.2.8 2.2.7 2.2.6 2.2.5 2.2.4 2.2.3 trunk 1.0.0 1.0.1 2.0.0 2.0.1 2.1.0 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2
table-builder-block / table-builder-block.php

table-builder-block.php in TableKit – WordPress Table Builder for Data Tables, WooCommerce Product Tables & Post Tables 2.1.0, at table-builder-block.php

98 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Table Builder Block
4 * Description: Powerful table builder block for Gutenberg block editor.
5 * Requires at least: 6.1
6 * Requires PHP: 7.4
7 * Plugin URI: https://wpmet.com/plugin/gutenkit/
8 * Author: Wpmet
9 * Version: 2.1.0
10 * Author URI: https://wpmet.com/
11 * License: GPL-3.0-or-later
12 * License URI: https://www.gnu.org/licenses/gpl-3.0.html
13 *
14 * Text Domain: table-builder-block
15 * Domain Path: /languages
16 */
17
18 // Exit if accessed directly.
19 if ( ! defined( 'ABSPATH' ) ) {
20 exit;
21 }
22
23 final class TableBuilder {
24 /**
25 * plugin version
26 *
27 * @var string
28 */
29 const VERSION = '2.1.0';
30
31 private static $instance = null;
32
33 public static function get_instance(): TableBuilder {
34 if ( null === self::$instance ) {
35 self::$instance = new self();
36 }
37 return self::$instance;
38 }
39
40 private function __construct() {
41 /**
42 * Plugins helper constants
43 *
44 * @return void
45 * @since 1.0.0
46 */
47 $this->define_constants();
48
49 /**
50 * Make sure ADD AUTOLOAD is scoped/vendor/scoper-autoload.php file
51 *
52 * @return void
53 * @since 2.0.1
54 */
55 require_once TABLE_BUILDER_BLOCK_PLUGIN_DIR . '/scoped/vendor/scoper-autoload.php';
56
57 /**
58 * Fires after initialization of the GutenKit plugin
59 *
60 * @return void
61 * @since 1.0.0
62 */
63 add_action( 'plugins_loaded', [ $this, 'on_plugins_loaded' ] );
64 }
65
66 private function define_constants(): void {
67 define( 'TABLE_BUILDER_BLOCK_PLUGIN_VERSION', self::VERSION );
68 define( 'TABLE_BUILDER_BLOCK_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
69 define( 'TABLE_BUILDER_BLOCK_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
70 define( 'TABLE_BUILDER_BLOCK_INC_DIR', TABLE_BUILDER_BLOCK_PLUGIN_DIR . 'includes/' );
71 define( 'TABLE_BUILDER_BLOCK_STYLE_DIR', TABLE_BUILDER_BLOCK_PLUGIN_DIR . 'build/styles/' );
72 define( 'TABLE_BUILDER_BLOCK_DIR', TABLE_BUILDER_BLOCK_PLUGIN_DIR . 'build/blocks/' );
73 }
74
75 public function on_plugins_loaded(): void {
76 do_action( 'tablebuilder/before_init' );
77
78 TableBuilder\Hooks\AssetGenerator::instance();
79 TableBuilder\Core\Enqueue::instance();
80 TableBuilder\Config\Blocks::instance();
81 TableBuilder\Admin\Admin::instance();
82
83 // Data migration
84 // TODO:: WIll be removed in next upcoming version
85 (new TableBuilder\Core\DataMigration());
86
87 add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), [ $this, 'plugin_action_link' ] );
88 }
89
90 public function plugin_action_link( array $plugin_actions ): array {
91 return $plugin_actions;
92 }
93 }
94
95 if ( class_exists( 'TableBuilder' ) ) {
96 TableBuilder::get_instance();
97 }
98