woocommerce
Last commit date
assets
2 years ago
client
2 years ago
i18n
2 years ago
includes
2 years ago
lib
2 years ago
packages
2 years ago
patterns
2 years ago
sample-data
2 years ago
src
2 years ago
templates
2 years ago
vendor
2 years ago
license.txt
6 years ago
readme.txt
2 years ago
uninstall.php
3 years ago
woocommerce.php
2 years ago
woocommerce.php
74 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: WooCommerce |
| 4 | * Plugin URI: https://woo.com/ |
| 5 | * Description: An ecommerce toolkit that helps you sell anything. Beautifully. |
| 6 | * Version: 8.6.0 |
| 7 | * Author: Automattic |
| 8 | * Author URI: https://woo.com |
| 9 | * Text Domain: woocommerce |
| 10 | * Domain Path: /i18n/languages/ |
| 11 | * Requires at least: 6.3 |
| 12 | * Requires PHP: 7.4 |
| 13 | * |
| 14 | * @package WooCommerce |
| 15 | */ |
| 16 | |
| 17 | defined( 'ABSPATH' ) || exit; |
| 18 | |
| 19 | if ( ! defined( 'WC_PLUGIN_FILE' ) ) { |
| 20 | define( 'WC_PLUGIN_FILE', __FILE__ ); |
| 21 | } |
| 22 | |
| 23 | if ( ! defined( 'WC_BLOCKS_IS_FEATURE_PLUGIN' ) ) { |
| 24 | define( 'WC_BLOCKS_IS_FEATURE_PLUGIN', true ); |
| 25 | } |
| 26 | |
| 27 | // Test Change |
| 28 | |
| 29 | // Load core packages and the autoloader. |
| 30 | require __DIR__ . '/src/Autoloader.php'; |
| 31 | require __DIR__ . '/src/Packages.php'; |
| 32 | |
| 33 | if ( ! \Automattic\WooCommerce\Autoloader::init() ) { |
| 34 | return; |
| 35 | } |
| 36 | \Automattic\WooCommerce\Packages::init(); |
| 37 | |
| 38 | // Include the main WooCommerce class. |
| 39 | if ( ! class_exists( 'WooCommerce', false ) ) { |
| 40 | include_once dirname( WC_PLUGIN_FILE ) . '/includes/class-woocommerce.php'; |
| 41 | } |
| 42 | |
| 43 | // Initialize dependency injection. |
| 44 | $GLOBALS['wc_container'] = new Automattic\WooCommerce\Container(); |
| 45 | |
| 46 | /** |
| 47 | * Returns the main instance of WC. |
| 48 | * |
| 49 | * @since 2.1 |
| 50 | * @return WooCommerce |
| 51 | */ |
| 52 | function WC() { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid |
| 53 | return WooCommerce::instance(); |
| 54 | } |
| 55 | |
| 56 | /** |
| 57 | * Returns the WooCommerce object container. |
| 58 | * Code in the `includes` directory should use the container to get instances of classes in the `src` directory. |
| 59 | * |
| 60 | * @since 4.4.0 |
| 61 | * @return \Automattic\WooCommerce\Container The WooCommerce object container. |
| 62 | */ |
| 63 | function wc_get_container() { |
| 64 | return $GLOBALS['wc_container']; |
| 65 | } |
| 66 | |
| 67 | // Global for backwards compatibility. |
| 68 | $GLOBALS['woocommerce'] = WC(); |
| 69 | |
| 70 | // Jetpack's Rest_Authentication needs to be initialized even before plugins_loaded. |
| 71 | if ( class_exists( \Automattic\Jetpack\Connection\Rest_Authentication::class ) ) { |
| 72 | \Automattic\Jetpack\Connection\Rest_Authentication::init(); |
| 73 | } |
| 74 |