PluginProbe
Gmap Block / 1.2.2
Gmap Block v1.2.2
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.1.0 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4
gmap-block / gmap-block.php

gmap-block.php in Gmap Block 1.2.2, at gmap-block.php

107 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: Gmap Block
4 * Description: A custom Gutenberg block to display google map in Gutenberg editor.
5 * Author: Zakaria Binsaifullah
6 * Version: 1.2.2
7 * Text Domain: gmap-block
8 * Domain Path: /languages
9 * License: GPLv2 or later
10 * License URI: http://www.gnu.org/licenses/gpl-2.0.html
11 *
12 * @package GmapBlock
13 */
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 if ( ! class_exists( 'Gmap_Block ' ) ) {
20
21 /**
22 * Gmap Blocks Final Class
23 *
24 * @since 1.0.0
25 * @package GmapBlock
26 */
27 final class GmapBlock {
28
29 // Plugin Version
30 const VERSION = '1.2.2';
31
32 /**
33 * Gmap Blocks Instance
34 *
35 * @since 1.0.0
36 */
37 private static $instance;
38
39 /**
40 * Gmap Blocks Constructor
41 *
42 * @since 1.0.0
43 * @return void
44 */
45 private function __construct() {
46 $this->constants();
47 $this->includes();
48 }
49
50 /**
51 * Gmap Blocks Define Constants
52 *
53 * @since 1.0.0
54 * @return void
55 */
56 public function constants() {
57 define( 'GMAP_VERSION', self::VERSION );
58 define( 'GMAP__FILE__', __FILE__ );
59 define( 'GMAP_URL_FILE', plugin_dir_url( __FILE__ ) );
60 define( 'GMAP_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
61 define( 'GMAP_URL', plugins_url( '/', plugin_dir_path( __FILE__ ) ) );
62 }
63
64 /**
65 * Gmap Blocks Instance
66 *
67 * @since 1.0.0
68 * @return GmapBlock
69 */
70 public static function get_instance() {
71 if ( is_null( self::$instance ) ) {
72 self::$instance = new self();
73 }
74
75 return self::$instance;
76 }
77
78 /**
79 * Gmap Blocks Includes Files
80 *
81 * @since 1.0.0
82 * @return void
83 */
84 private function includes() {
85 require_once trailingslashit( GMAP_PLUGIN_DIR ) . 'inc/gmap-block-loader.php';
86 }
87 }
88
89 }
90
91 /**
92 * Gmap Blocks
93 *
94 * @since 1.0.0
95 * @return GmapBlock
96 */
97 function gmap_blocks() {
98 return GmapBlock::get_instance();
99 }
100
101 /**
102 * Initialize Gmap Blocks
103 *
104 * @since 1.0.0
105 */
106 gmap_blocks(); // Initialize the Gmap Blocks class.
107