-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathwc-pv.php
63 lines (58 loc) · 2.04 KB
/
wc-pv.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
<?php
/**
* Phone Validator for WooCommerce
*
* @package PluginPackage
* @author Precious Omonzejele (CodeXplorer 🤾🏽♂️🥞🦜🤡)
*
* @wordpress-plugin
* Plugin Name: Phone Validator for WooCommerce
* Plugin URI: https://github.com/Preciousomonze/woocommerce-phone-validator
* Description: Phone Validator for WooCommerce Helps in validating international telephone numbers on WooCommerc billing address.
* Author: Precious Omonzejele (CodeXplorer 🤾🏽♂️🥞🦜🤡)
* Author URI: https://codexplorer.ninja
* Version: 1.2.1
* Requires at least: 5.0
* Tested up to: 5.4
* WC requires at least: 3.0
* WC tested up to: 4.3
*
* Text Domain: woo-phone-validator
* Domain Path: /languages
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// make sure you update the version values when necessary
define( 'WC_PV_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'WC_PV_PLUGIN_FILE', __FILE__ );
define( 'WC_PV_TEXT_DOMAIN', 'woo-phone-validator' );
define( 'WC_PV_PLUGIN_VERSION', '1.2.1' );
/**
* Environment, should be either test or production
* Note: if youre on localhost, even if you change this constant to production, it'll still use test :)
*/
$_wc_pv_env = 'production';
if ( isset( $_SERVER['SERVER_NAME'] ) && strpos( sanitize_text_field( $_SERVER['SERVER_NAME'] ), 'localhost' ) !== false || ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ) {
$_wc_pv_env = 'test';
}
define( 'WC_PV_ENVIRONMENT', $_wc_pv_env );
// for global option meta access :)
// $wc_pv_option_meta = array();
// custom fields names
$wc_pv_woo_custom_field_meta = array(
'billing_hidden_phone_field' => '_wc_pv_phone_validator',
'billing_hidden_phone_err_field' => '_wc_pv_phone_validator_err',
);
// include dependencies file
if ( ! class_exists( 'WC_PV_Dependencies' ) ) {
include_once dirname( __FILE__ ) . '/includes/class-wc-pv-deps.php';
}
// Include the main class.
if ( ! class_exists( 'WC_PV' ) ) {
include_once dirname( __FILE__ ) . '/includes/class-wc-pv.php';
}
function wc_pv() {
return WC_PV::instance();
}
$GLOBALS['wc_pv'] = wc_pv();