2011-08-10 17:11:11 +00:00
|
|
|
<?php
|
2012-03-20 13:22:35 +00:00
|
|
|
/**
|
|
|
|
* Plugin Name: WooCommerce
|
2016-07-05 22:52:16 +00:00
|
|
|
* Plugin URI: https://woocommerce.com/
|
2017-12-19 14:12:07 +00:00
|
|
|
* Description: An eCommerce toolkit that helps you sell anything. Beautifully.
|
2020-09-09 14:53:26 +00:00
|
|
|
* Version: 4.5.1
|
2017-02-09 17:08:39 +00:00
|
|
|
* Author: Automattic
|
2016-09-27 15:44:48 +00:00
|
|
|
* Author URI: https://woocommerce.com
|
2012-03-20 13:22:35 +00:00
|
|
|
* Text Domain: woocommerce
|
2012-12-28 10:54:02 +00:00
|
|
|
* Domain Path: /i18n/languages/
|
2020-09-08 17:19:24 +00:00
|
|
|
* Requires at least: 5.3
|
2020-05-27 12:58:41 +00:00
|
|
|
* Requires PHP: 7.0
|
2012-08-07 08:38:08 +00:00
|
|
|
*
|
2012-03-20 13:22:35 +00:00
|
|
|
* @package WooCommerce
|
|
|
|
*/
|
2017-07-13 18:59:50 +00:00
|
|
|
|
2019-01-23 16:19:40 +00:00
|
|
|
defined( 'ABSPATH' ) || exit;
|
2011-08-10 17:11:11 +00:00
|
|
|
|
2017-07-10 23:53:54 +00:00
|
|
|
if ( ! defined( 'WC_PLUGIN_FILE' ) ) {
|
|
|
|
define( 'WC_PLUGIN_FILE', __FILE__ );
|
|
|
|
}
|
|
|
|
|
2020-04-07 00:07:33 +00:00
|
|
|
// Load core packages and the autoloader.
|
|
|
|
require __DIR__ . '/src/Autoloader.php';
|
|
|
|
require __DIR__ . '/src/Packages.php';
|
2019-06-25 12:13:04 +00:00
|
|
|
|
2020-04-07 00:07:33 +00:00
|
|
|
if ( ! \Automattic\WooCommerce\Autoloader::init() ) {
|
|
|
|
return;
|
2019-06-21 12:41:10 +00:00
|
|
|
}
|
2020-04-07 00:07:33 +00:00
|
|
|
\Automattic\WooCommerce\Packages::init();
|
2019-06-21 12:41:10 +00:00
|
|
|
|
2017-07-10 23:51:27 +00:00
|
|
|
// Include the main WooCommerce class.
|
2019-06-25 12:13:04 +00:00
|
|
|
if ( ! class_exists( 'WooCommerce', false ) ) {
|
2019-11-04 22:27:30 +00:00
|
|
|
include_once dirname( WC_PLUGIN_FILE ) . '/includes/class-woocommerce.php';
|
2013-06-11 14:21:14 +00:00
|
|
|
}
|
|
|
|
|
2020-06-09 10:53:46 +00:00
|
|
|
// Initialize dependency injection.
|
2020-06-18 12:15:08 +00:00
|
|
|
$GLOBALS['wc_container'] = new Automattic\WooCommerce\Container();
|
2020-06-09 10:53:46 +00:00
|
|
|
|
2013-06-11 14:21:14 +00:00
|
|
|
/**
|
2019-01-23 16:19:40 +00:00
|
|
|
* Returns the main instance of WC.
|
2013-06-11 14:21:14 +00:00
|
|
|
*
|
|
|
|
* @since 2.1
|
2013-09-25 13:10:40 +00:00
|
|
|
* @return WooCommerce
|
2013-06-11 14:21:14 +00:00
|
|
|
*/
|
2019-02-18 11:55:36 +00:00
|
|
|
function WC() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
|
2020-06-11 07:53:26 +00:00
|
|
|
return WooCommerce::instance();
|
2013-06-11 14:21:14 +00:00
|
|
|
}
|
2011-12-08 12:50:50 +00:00
|
|
|
|
2020-06-18 12:15:08 +00:00
|
|
|
/**
|
|
|
|
* Returns the WooCommerce PSR11-compatible object container.
|
|
|
|
* Code in the `includes` directory should use the container to get instances of classes in the `src` directory.
|
|
|
|
*
|
|
|
|
* @return \Psr\Container\ContainerInterface The WooCommerce PSR11 container.
|
|
|
|
*/
|
2020-06-22 09:41:11 +00:00
|
|
|
function wc_get_container() : \Psr\Container\ContainerInterface {
|
2020-06-18 12:15:08 +00:00
|
|
|
return $GLOBALS['wc_container'];
|
|
|
|
}
|
|
|
|
|
2013-09-25 03:11:42 +00:00
|
|
|
// Global for backwards compatibility.
|
2018-11-08 10:59:07 +00:00
|
|
|
$GLOBALS['woocommerce'] = WC();
|