-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgmop.php
77 lines (62 loc) · 2.05 KB
/
gmop.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
* Plugin Name: Google Maps Objects Plus
* Plugin URI: https://blog.meloniq.net/
* Description: Showing maps based on location saved in post meta with closest objects definied in administration panel.
*
* Requires at least: 6.0
* Requires PHP: 7.4
* Version: 1.1
*
* Author: MELONIQ.NET
* Author URI: https://blog.meloniq.net
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: gmop
*/
namespace meloniq\GMOP;
// If this file is accessed directly, then abort.
if ( ! defined( 'WPINC' ) ) {
die;
}
define( 'GMOP_TD', 'gmop' );
define( 'GMOP_FILE', __FILE__ );
/**
* Setup Plugin data.
*
* @return void
*/
function setup() {
global $mnet_gmop;
require_once( dirname( __FILE__ ) . '/src/class-install.php' );
require_once( dirname( __FILE__ ) . '/src/class-shortcode.php' );
require_once( dirname( __FILE__ ) . '/src/class-frontend.php' );
$mnet_gmop['install'] = new Install();
$mnet_gmop['shortcode'] = new Shortcode();
$mnet_gmop['frontend'] = new Frontend();
// admin pages
if ( is_admin() ) {
require_once( dirname( __FILE__ ) . '/src/class-overview.php' );
require_once( dirname( __FILE__ ) . '/src/class-settings.php' );
require_once( dirname( __FILE__ ) . '/src/class-objects.php' );
require_once( dirname( __FILE__ ) . '/src/class-object-types.php' );
$mnet_gmop['overview'] = new Overview();
$mnet_gmop['settings'] = new Settings();
$mnet_gmop['objects'] = new Objects();
$mnet_gmop['object_types'] = new Object_Types();
}
}
add_action( 'after_setup_theme', 'meloniq\GMOP\setup' );
/**
* Load Text-Domain
*/
function load_textdomain() {
load_plugin_textdomain( 'gmop', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
}
add_action( 'plugins_loaded', 'meloniq\GMOP\load_textdomain' );
/**
* Load functions, register tables
*/
require_once( dirname( __FILE__ ) . '/gmop-functions.php' );
gmop_register_table( 'gmop_markers' );
gmop_register_table( 'gmop_objects' );