| 1 |
<?php |
| 2 |
/* |
| 3 |
Plugin Name: zipaddr-jp |
| 4 |
Plugin URI: https://zipaddr2.com/wordpress/ |
| 5 |
Description: The input convert an address from a zip code automatically. |
| 6 |
Version: 1.38 |
| 7 |
Author: Tatsuro, Terunuma |
| 8 |
Author URI: https://pierre-soft.com/ |
| 9 |
*/ |
| 10 |
define('zipaddr_VERS', '1.38'); |
| 11 |
define('zipaddr_KEYS', 'zipaddr-config'); |
| 12 |
define('zipaddr_SYS', 'sys_'); |
| 13 |
define('zipaddr_COM', 'https://zipaddr.com/'); |
| 14 |
define('zipaddr2COM', 'https://zipaddr2.com/'); |
| 15 |
define('zipaddr_git', 'https://zipaddr.github.io/'); |
| 16 |
define('zipaddr_DEFINE', 'zipaddr_define'); |
| 17 |
define('zipaddrMei', plugin_basename(dirname(__FILE__))); |
| 18 |
define('zipaddr_PLUGIN_DIR', plugin_dir_path(__FILE__)); // /myplugin/ |
| 19 |
define('zipaddr_FILE1', str_replace("/".zipaddrMei."/","",zipaddr_PLUGIN_DIR)."/zipaddr_define.txt"); //�� |
| 20 |
define('zipaddr_FILE2', zipaddr_PLUGIN_DIR."include/zipaddrjp_define.php"); //�V |
| 21 |
|
| 22 |
$plugin_name= ""; |
| 23 |
if( isset($_GET['page']) ){ |
| 24 |
$plugin_name= trim($_GET['page']); |
| 25 |
$plugin_name= htmlspecialchars($plugin_name, ENT_QUOTES); |
| 26 |
$plugin_name= substr($plugin_name,0,6); |
| 27 |
} |
| 28 |
require_once zipaddr_PLUGIN_DIR.'include/zipaddrjp_config.php'; |
| 29 |
|
| 30 |
if( is_admin() && $plugin_name == "usces_" ){ // welcart |
| 31 |
define( 'zipaddr_IDENT', '3'); |
| 32 |
require_once zipaddr_PLUGIN_DIR.'zipaddr.php'; |
| 33 |
add_filter('usces_filter_apply_admin_addressform', 'zipaddr_jp_usces', 99999, 3);// welcart |
| 34 |
} |
| 35 |
else |
| 36 |
if( is_admin() ){ // admin |
| 37 |
define( 'zipaddr_IDENT', '2'); |
| 38 |
require_once zipaddr_PLUGIN_DIR.'admin.php'; |
| 39 |
add_action('admin_menu', 'zipaddr_admin_menu'); |
| 40 |
if( function_exists('register_uninstall_hook') ) {register_uninstall_hook( __FILE__, 'zipaddr_uninstall' );} // uninstall�ďo�� |
| 41 |
} |
| 42 |
else { // user |
| 43 |
define( 'zipaddr_IDENT', '1'); |
| 44 |
require_once zipaddr_PLUGIN_DIR.'zipaddr.php'; |
| 45 |
add_filter('usces_filter_apply_addressform', 'zipaddr_jp_usces', 99999, 3);// welcart |
| 46 |
add_filter('usces_filter_cart_delivery_script','zipaddr_jp_welcart', 99999, 3);// welcart |
| 47 |
add_filter('the_content', 'zipaddr_jp_change', 99999); // html change |
| 48 |
} |
| 49 |
?> |
| 50 |
|