-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathplugin.php
51 lines (40 loc) · 1.63 KB
/
plugin.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
<?php
/*
Plugin Name: UI Leaflet Integration
Plugin URI: https://github.com/ginsterbusch/ui-leaflet-integration
Description: The most less excessive Leaflet map integration. Keeping it simple with a shortcode (and in the future, a shortcode generator interface). Uses the latest Leaflet libary (1.6). Compatible with ClassicPress 1.x.
Tags: map, maps, Leaflet, OpenStreetMap, location, geocoding, geolocation, OpenLayers, geotagging, position, google maps, classicpress
Version: 0.9.6
Author: Fabian Wolf
Author URI: https://usability-idealist.net
License: GNU GPL v2
Requires at least: 4.1
Tested up to: 5.3
*/
// init
if( !defined( '_UI_LEAFLET_MAP_PATH' ) ) {
define( '_UI_LEAFLET_MAP_PATH', plugin_dir_path( __FILE__ ) );
}
if( !defined( '_UI_LEAFLET_MAP_URL' ) ) {
define( '_UI_LEAFLET_MAP_URL', plugin_dir_url( __FILE__ ) );
}
// includes
require_once( plugin_dir_path(__FILE__ ) . 'includes/base.class.php');
if( !class_exists( '_ui_LeafletIntegration' ) ) {
require_once( plugin_dir_path(__FILE__ ) . 'includes/leaflet-map.class.php');
}
// helper functions lib
require_once( _UI_LEAFLET_MAP_PATH . 'includes/functions.php' );
// for future versions
if( file_exists( plugin_dir_path(__FILE__ ) . 'includes/admin.class.php' ) ) {
require_once( plugin_dir_path(__FILE__ ) . 'includes/admin.class.php' );
}
// main
/**
* TODO: Check if 'init' is really the right hook, esp. with the assets OD function (as it fires with the 'wp' hook)
*/
add_action( 'init', array( '_ui_LeafletIntegration', 'init' ) );
//if( class_exists( '_ui_LeafletAdmin' ) ) {
//add_action( 'admin_init', array( '_ui_LeafletAdmin', 'init' ) );
//_ui_LeafletAdmin::init();
//}