| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Block for Apple Maps |
| 4 |
* Plugin URI: https://github.com/10up/maps-block-apple |
| 5 |
* Description: An Apple Maps block for the WordPress block editor (Gutenberg). |
| 6 |
* Version: 1.1.5 |
| 7 |
* Requires at least: 6.6 |
| 8 |
* Requires PHP: 7.4 |
| 9 |
* Author: 10up |
| 10 |
* Author URI: https://10up.com |
| 11 |
* License: GPL-2.0-or-later |
| 12 |
* License URI: https://spdx.org/licenses/GPL-2.0-or-later.html |
| 13 |
* Text Domain: maps-block-apple |
| 14 |
* |
| 15 |
* @package tenup\Maps_Block_Apple |
| 16 |
*/ |
| 17 |
|
| 18 |
namespace tenup\Maps_Block_Apple; |
| 19 |
|
| 20 |
// Useful global constants. |
| 21 |
define( 'MAPS_BLOCK_APPLE_VERSION', '1.1.5' ); |
| 22 |
define( 'MAPS_BLOCK_APPLE_URL', plugin_dir_url( __FILE__ ) ); |
| 23 |
define( 'MAPS_BLOCK_APPLE_PATH', dirname( __FILE__ ) . '/' ); |
| 24 |
define( 'MAPS_BLOCK_APPLE_INC', MAPS_BLOCK_APPLE_PATH . 'includes/' ); |
| 25 |
define( 'MAPS_BLOCK_APPLE_BASENAME', plugin_basename( __FILE__ ) ); |
| 26 |
|
| 27 |
|
| 28 |
// Validate Environment. |
| 29 |
$is_environment_satisfy = require MAPS_BLOCK_APPLE_INC . 'environment-validation.php'; |
| 30 |
if ( ! $is_environment_satisfy ) { |
| 31 |
return; |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
/** |
| 36 |
* Add options |
| 37 |
*/ |
| 38 |
function add_options() { |
| 39 |
add_option( 'maps_block_apple_team_id' ); |
| 40 |
add_option( 'maps_block_apple_key_id' ); |
| 41 |
add_option( 'maps_block_apple_private_key' ); |
| 42 |
} |
| 43 |
add_action( 'init', __NAMESPACE__ . '\add_options' ); |
| 44 |
|
| 45 |
require_once MAPS_BLOCK_APPLE_INC . 'block-assets.php'; |
| 46 |
require_once MAPS_BLOCK_APPLE_INC . 'rest-routes.php'; |
| 47 |
require_once MAPS_BLOCK_APPLE_INC . 'settings.php'; |
| 48 |
|
| 49 |
// Initialize the settings page. |
| 50 |
Settings\setup(); |
| 51 |
|