woo-checkout-field-editor-pro
Last commit date
admin
3 weeks ago
block
3 weeks ago
includes
3 weeks ago
languages
3 weeks ago
public
3 weeks ago
changelog.txt
3 weeks ago
checkout-form-designer.php
3 weeks ago
readme.txt
2 weeks ago
checkout-form-designer.php
58 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: Checkout Field Editor for WooCommerce |
| 4 | * Description: Customize WooCommerce checkout fields(Add, Edit, Delete and re-arrange fields). |
| 5 | * Author: ThemeHigh |
| 6 | * Version: 2.1.9 |
| 7 | * Author URI: https://www.themehigh.com |
| 8 | * Plugin URI: https://www.themehigh.com |
| 9 | * License: GPLv2 or later |
| 10 | * Text Domain: woo-checkout-field-editor-pro |
| 11 | * Domain Path: /languages |
| 12 | * WC requires at least: 3.0.0 |
| 13 | * WC tested up to: 10.8 |
| 14 | */ |
| 15 | |
| 16 | if(!defined( 'ABSPATH' )) exit; |
| 17 | |
| 18 | if (!function_exists('is_woocommerce_active')){ |
| 19 | function is_woocommerce_active(){ |
| 20 | $active_plugins = (array) get_option('active_plugins', array()); |
| 21 | if(is_multisite()){ |
| 22 | $active_plugins = array_merge($active_plugins, get_site_option('active_sitewide_plugins', array())); |
| 23 | } |
| 24 | return in_array('woocommerce/woocommerce.php', $active_plugins) || array_key_exists('woocommerce/woocommerce.php', $active_plugins) || class_exists('WooCommerce'); |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | if(is_woocommerce_active()) { |
| 29 | define('THWCFD_VERSION', '2.1.9'); |
| 30 | !defined('THWCFD_BASE_NAME') && define('THWCFD_BASE_NAME', plugin_basename( __FILE__ )); |
| 31 | !defined('THWCFD_PATH') && define('THWCFD_PATH', plugin_dir_path( __FILE__ )); |
| 32 | !defined('THWCFD_URL') && define('THWCFD_URL', plugins_url( '/', __FILE__ )); |
| 33 | !defined('THWCFD_ABSPATH' ) && define( 'THWCFD_ABSPATH', __DIR__ ); |
| 34 | |
| 35 | #require THWCFD_PATH . 'classes/class-thwcfd.php'; |
| 36 | require plugin_dir_path( __FILE__ ) . 'includes/class-thwcfd.php'; |
| 37 | |
| 38 | function run_thwcfd() { |
| 39 | $plugin = new THWCFD(); |
| 40 | } |
| 41 | run_thwcfd(); |
| 42 | } |
| 43 | |
| 44 | if( ! function_exists( 'activate_thwcfd' ) ) { |
| 45 | function activate_thwcfd($network_wide) { |
| 46 | require_once plugin_dir_path( __FILE__ ) . 'includes/class-thwcfd-activator.php'; |
| 47 | THWCFD_Activator::activate($network_wide); |
| 48 | } |
| 49 | } |
| 50 | register_activation_hook( __FILE__, 'activate_thwcfd' ); |
| 51 | |
| 52 | add_action( 'before_woocommerce_init', 'thwcfd_before_woocommerce_init_hpos' ) ; |
| 53 | |
| 54 | function thwcfd_before_woocommerce_init_hpos() { |
| 55 | if ( class_exists( '\Automattic\WooCommerce\Utilities\FeaturesUtil' ) ) { |
| 56 | \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); |
| 57 | } |
| 58 | } |